环境是Ubuntu 9.04, 首先当然是安装Apache2。
1. 进入mod_availables下拷贝proxy.conf, proxy.load, proxy_http.load到mod_enables下
2. 配置:
编辑proxy.conf:
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /foo http://foo.example.com/bar
ProxyPassReverse /foo http://foo.example.com/bar
只需要对应的修改上述的url即可。如果需要使用二级代理则使用ProxyRemote命令。具体的说明可以参见:
http://man.chinaunix.net/newsoft/Apache2.2_chinese_manual/mod/mod_proxy.html