准备好 apr-1.5.2.tar、apr-util-1.5.4.tar、pcre-8.39.tar、httpd-2.4.23.tar
1,安装 apr
[root@:/usr/local/apache]#tar xzvf apr-1.5.2.tar.gz
[root@:/usr/local/apache/apr-1.5.2]#./configure --prefix=/work/installed/apr-152
[root@:/usr/local/apache/apr-1.5.2]#make
[root@:/usr/local/apache/apr-1.5.2]#make install
2,安装 apr-util
[root@:/usr/local/apache]#tar xzvf apr-util-1.5.4.tar.gz
[root@:/usr/local/apache/apr-util-1.5.4]# ./configure --prefix=/work/installed/apr-util-154 --with-apr=/work/installed/apr-152
[root@:/usr/local/apache/apr-util-1.5.4]#make
[root@:/usr/local/apache/apr-util-1.5.4]#make install
3,安装 pcre
[root@:/usr/local/apache]#tar xzvf pcre-8.39.tar.gz
[root@:/usr/local/apache/pcre-8.39]# ./configure --prefix=/work/installed/pcre-839
[root@:/usr/local/apache/pcre-8.39]#make
[root@:/usr/local/apache/pcre-8.39]#make install
4,安装 httpd
[root@:/usr/local/apache]#tar xzvf httpd-2.4.23.tar.gz
[root@:/usr/local/apache/httpd-2.4.23]# ./configure --prefix=/work/installed/apache --enable-ssl --enable-ssl --enable-cgi --enable-rewrite --with-apr=/work/installed/apr-152 --with-apr-util=/work/installed/apr-util-154 --with-pcre=/work/installed/pcre-839
[root@:/usr/local/apache/httpd-2.4.23]#make
[root@:/usr/local/apache/httpd-2.4.23]#make install
5, 修改 /work/installed/apache/conf/httpd.conf
ServerName 127.0.0.1
去掉 /work/installed/apache/conf/httpd.conf的这几个#
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
修改 /work/installed/apache/conf/extra/httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot "/work/installed/apache/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error_log"
CustomLog "logs/dummy-host.example.com-access_log" common
ProxyRequests On
ProxyVia On
<Proxy *>
Order deny,allow
Deny from 172.0.0.0
Allow from all
</Proxy>
</VirtualHost>
6,启动
[root@:/work/installed/apache]# ./bin/apachectl start