2007-06-15
squid 2.6 反向代理配置
http_port 192.168.1.233:80 defaultsite=192.168.1.150 vhost vport=80 acl all src 0.0.0.0/0.0.0.0 只有一个IP,但是有几台机器要发布到internet上,便想起用squid来做个反向代理,只是起转发请求的作用,不缓存东西。
cache_peer 192.168.1.150 parent 80 0 no-query originserver
cache_peer 192.168.1.233 parent 100 0 no-query originserver
cache_peer_domain 192.168.1.150 www.xx.cn
cache_peer_domain 192.168.1.233 www.aa.cn
acl Safe_ports port 80
acl Safe_ports port 443
http_access deny !Safe_ports
http_access allow all
refresh_pattern -i . 0 100% 0 reload-into-ims
评论
无明
2007-06-15
apache 虚拟主机加 mod-proxy当然也可以,但效率上就不能跟squid相比了
codeutil
2007-06-15
apache 虚拟主机加 mod-proxy可以不???
这样应该也可以满足需求.
NameVirtualHost *
<VirtualHost *>
ServerAdmin admin@www.xx.cn
DocumentRoot /www/docs/www.xx.cn
ServerName www.xx.cn
ServerAlias ww.xx.cn
ErrorLog logs/www.xx.cn-error_log
CustomLog logs/www.xx.cn-access_log common
<Location /balancer-manager>
SetHandler balancer-manager
Order allow,deny
Allow from 127.0.0.1
Allow from localhost
</Location>
ProxyPass /balancer-manager !
ProxyPass / balancer://tomcatcluster/ lbmethod=byrequests stickysession=JSESSIONID nofailover=Off timeout=30 maxattempts=3
ProxyPassReverse / balancer://tomcatcluster/
<Proxy balancer://tomcatcluster>
BalancerMember http://192.168.1.150 loadfactor=10 smax=10 max=10 ttl=5 timeout=30 acquire=3 route=tomcat12080
</Proxy>
</VirtualHost>
<VirtualHost *>
ServerAdmin admin@www.aa.cn
DocumentRoot /www/docs/www.aa.cn
ServerName www.aa.cn
ServerAlias ww.aa.cn
ErrorLog logs/www.aa.cn-error_log
CustomLog logs/www.aa.cn_log common
<Location /balancer-manager>
SetHandler balancer-manager
Order allow,deny
# 允许本机自身访问
Allow from 127.0.0.1
Allow from localhost
</Location>
ProxyPass /balancer-manager !
ProxyPass / balancer://tomcatcluster/ lbmethod=byrequests stickysession=JSESSIONID nofailover=Off timeout=30 maxattempts=3
ProxyPassReverse / balancer://tomcatcluster/
<Proxy balancer://tomcatcluster>
BalancerMember http://192.168.1.233 smax=10 max=10 ttl=5 timeout=30 acquire=3 route=tomcat11080
</Proxy>
</VirtualHost>
这样应该也可以满足需求.
无明
2007-06-15
各自独立,而且运行的端口不一,但都要求以80对外提供服务。简单的端口映射不能解决,不然我用路由或者iptables就可以了,也不用装啥软件。
glassprogrammer
2007-06-15
想问一下你这几台机器是不是各自独立的, 发布出来的应用也不需要使用同一个端口吧, 如果这样何不试试 yap 端口映射工具呢?
http://sourceforge.net/projects/yap-mu/
当然, 如果你要在 linux 下跑算我没说, 呵呵.
http://sourceforge.net/projects/yap-mu/
当然, 如果你要在 linux 下跑算我没说, 呵呵.
- 浏览: 21218 次
- 性别:

- 来自: 深圳

- 详细资料
搜索本博客
最近加入圈子
最新评论
-
mysql的双重许可
MY$QL?改向PostgreSQL: Best of all, Postgr ...
-- by ray_linn -
mysql的双重许可
有点像Qt
-- by arust -
ExtJS tree in rails
高!我也正想找这样的例子,可是我还是不会使用。 首先,如何配置安装 ExtJS? ...
-- by simon_lin -
mysql的双重许可
7777777777777777777777777777
-- by chinapr -
ExtJS tree in rails
有个问题,这种to_json的方式性能上会有多大的损失吗?
-- by yishh






评论排行榜