apache 代理模块 proxy应用
要使用proxy功能,首先编译apache的时候,需要加上参数 --enable-proxy --enable-proxy-http
如果,不想重新编译,也可以以扩展的形式安装proxy模块,具体请参考 http://mylinux.5d6d.com/thread-939-1-1.html
具体配置为:<VirtualHost *:80>
ServerName www.test.com
CustomLog "/dev/null" combined
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://www.test.com/
ProxyPassReverse / 192.168.13.111/
</VirtualHost> 另外需要注意的是,需要在/etc/hosts 中加一条记录
192.168.13.111 www.test.com
如果,不想重新编译,也可以以扩展的形式安装proxy模块,具体请参考 http://mylinux.5d6d.com/thread-939-1-1.html
具体配置为:
ServerName www.test.com
CustomLog "/dev/null" combined
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://www.test.com/
ProxyPassReverse / 192.168.13.111/
</VirtualHost>
192.168.13.111 www.test.com
none