日期:2014-05-16  浏览次数:20735 次

apache 反向代理简单实现

1>修改 httpd.conf 文件中:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
模块功能设置为启用。

找到Include conf/extra/httpd-vhosts.conf,设置为启用。


2>修改conf/extra/httpd-vhosts.conf文件:
NameVirtualHost *:80
<VirtualHost *:80>
??? ServerAdmin webmaster@localhost
??? DocumentRoot "E:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
??? ServerName localhost80
??? ServerAlias localhost80
??? ErrorLog "logs/localhost80-error.log"
??? CustomLog "logs/localhost80-access.log" common
</VirtualHost>

Listen 6110
NameVirtualHost *:6110
<VirtualHost *:6110>
??? ServerAdmin webmaster@jjjc.xgzh.tax.cn
??? ServerName jjjc.xgzh.tax.cn
??? ErrorLog "logs/jjjc-error.log"
??? CustomLog "logs/jjjc-access.log" common
??? ProxyPass / http://jjjc.xgzh.tax.cn:7002/
??? ProxyPassReverse / http://jjjc.xgzh.tax.cn:7002/
</VirtualHost>

?