Apache/Tomcat tips

1. Apache httpd单地址多域名设置/Apache multi-name based on single IP
# Listen for virtual host requests on all IP addresses
NameVirtualHost *:443

<VirtualHost *:443>
DocumentRoot /www/example1
ServerName www.example.com

# Other directives here

</VirtualHost>

<VirtualHost *:443>
DocumentRoot /www/example2
ServerName www.example.org

# Other directives here

</VirtualHost>

一定注意红色这一句,否则你会出现这个错误,第二个virtualhost不生效/Without the red instruction, the second virtualhost definition wont take effect:

[Fri Jun 21 15:20:54 2013] [warn] _default_ VirtualHost overlap on port 443, the first has precedence

2. 如果你定义了ProxyPass /,你会发现其他的定义都覆盖了
ProxyPass / will override other definition under / unless if you put into a virtualhost section
3. 定义LogLevel 为debug可以检查问题
Change LogLovel directive to debug can be used for debug

Leave a Reply

Your email address will not be published. Required fields are marked *