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 [email protected]
    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>

 

你可能感兴趣的:(apache)