1、首先进入apache源码包安装目录下,/opt/src/apache-2.2.8/modules/proxy 2、使用apache安装路径命令: #/usr/loca/apache/bin/apxs -c -i -a mod_proxy.c proxy_util.c #/usr/loca/apache/bin/apxs -c -i -a mod_proxy_http.c proxy_util.c #/usr/loca/apache/bin/apxs -c -i -a mod_proxy_ajp.c ajp*.c 3、安装完毕后,httpd.conf文件中会自动添加模块名称;如图: 4、再到/usr/local/apache/conf/extra/目录下添加代理代码 <VirtualHost :80> ServerName 6g.xxxxx.com ProxyRequests Off ProxyPreserveHost On <Proxy /> Order deny,allow Allow from all </Proxy> ErrorLog "logs/error_log" CustomLog "logs/4g.xxxxx.com/access_log" common ProxyPass / http://127.0.0.1:8086/ 注意:ip地址端口你自己根据主机定义 ProxyPa**everse / http://127.0.0.1:8086/
</VirtualHost> 5、重新 apache服务即可使用 #/usr/local/apache/bin/apachectl -k restart 重启 #/usr/local/apache/bin/apachectl -k start 开启 #/usr/local/apache/bin/apachectl -k stop 关闭