apache-2.4.33的安装 #################apache的安装##########################

  1. mkdir -p /home/oldboy/tools mkdir -p /application

    cd /home/oldboy/tools wget http://mirrors.sohu.com/apache/httpd-2.4.33.tar.gz wget http://mirrors.hust.edu.cn/apache//apr/apr-1.6.3.tar.gz wget http://mirrors.hust.edu.cn/apache//apr/apr-util-1.6.1.tar.gz

    yum -y install gcc gcc-c++ pcre-devel openssl-devel yum install expat-devel (to resolve apr-util-1.6.1 error)

    cd /home/oldboy/tools tar -xf apr-1.6.3.tar.gz cd apr-1.6.3 ./configure --prefix=/usr/local/apr make make install

    cd /home/oldboy/tools tar -xf apr-util-1.6.1.tar.gz cd apr-util-1.6.1 ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr make make install

    tar -xf httpd-2.4.33.tar.gz cd httpd-2.4.33 ./configure --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --prefix=/usr/local/apache --sysconfdir=/etc/httpd24 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-mpm=prefork --enable-modules=most --enable-mpms-shared=all make make install

修改端口号 vim /etc/httpd24/httpd.conf ServerName 10.0.0.5:80 Listen 80

启动与停止 /usr/local/apache/bin/apachectl -k start netstat -lntup| grep 8080

vim /etc/rc.local /usr/local/apache/bin/apachectl -k start

验证 echo "This is a apached 2.4.9 version">>/usr/local/apache/htdocs/index.html