求救:LVS DR/IPIP模式下对apache vhost_alias模块支持的问题(have been resolved now)
求救:
在以上2种模式下,APACHE无法正常使用vhost_alias模块进行站点解析,据我的判断,应该是LVS在进行转发过程中改写了HTTP头的User-agent部分.有什么办法可以解决这个问题的么?
NAT模式下apache日志:
www.ccc.com [Tue Apr 17 11:11:38 2007] [error] [client 192.168.10.200] File does not exist: /www/home1/www/cc/c_/www.ccc.com/web/favicon.ico
DR/IPIP模式下APACHE日志:
www.ccc.com [Tue Apr 17 13:36:23 2007] [error] [client 10.2.0.251] Directory index forbidden by Options directive: /var/www/
www.ccc.com [Tue Apr 17 13:36:26 2007] [error] [client 10.2.0.251] Directory index forbidden by Options directive: /var/www/
www.ccc.com [Tue Apr 17 13:36:27 2007] [error] [client 10.2.0.251] Directory index forbidden by Options directive: /var/www/
为什么两种模式下,解析的地址会不一样呢?都是访问相同的域名,apache设置没有做任何更改.
george_gao
周四, 2007-04-19 06:01
Permalink
怎么没有人回复啊?
是不是大家都没碰到过类似的问题啊?
george_gao
周五, 2007-04-27 07:01
Permalink
问题已经解决,现在将解决方案给出(realserver 部分):
RealServer's configuration:
package list:
arptables_jf-0.0.8-8.i386.rpm
iptables-1.3.5-1.2.1.i386.rpm
config:
add a dummy IP on the lo:0 device:
touch a new NIC config file named ifcfg-lo:0 at /etc/sysconfig/network-scripts/, and fill in the configuration as below:
DEVICE=lo:0
IPADDR=[Virtul-IP(such as 192.168.0.100)]
NETMASK=255.255.255.255
ONBOOT=yes
NAME=loopback
run "ifup lo:0" to active the config.
add two arptales rules and save:
arptables -A IN -d [virtul-ip] -j DROP
arptables -A OUT -s [virtul-ip] -o eth0 -j mangle --mangle-ip-s [realserver-ip]
run "chkconfig --level 2345 arptables_jf on" to activice the arptables_jf service.
run "service arptables_jf save" to save the rules
add a iptables rules and save:
iptables -A PREROUTING -d [virtul-ip] -p tcp -m multiport --dports [service ports(format: port1,port2,port3,etc..)] -j REDIRECT
run "chkconfig --level 2345 iptables on" to activice the iptables service.
run "service iptables save" to save the rules.