apache2.2.11与TOMCAT6.0.10整合过程中我用虚拟主机配置
为什么APACHE配置了虚拟主机
TOMCAT还得再配置虚拟主机 才可以连接上?只配置APACHE虚拟主机相关路径,域名总是访问TOMCAT管理页面??D:\Apache2.2\conf\extra\httpd-vhosts.conf
===============================================<VirtualHost *:80>
ServerName www.test1.com
ServerAlias test1.com
DocumentRoot "D:/Tomcat6/webapps/test"
<Directory "D:/Tomcat6/webapps/test">
AllowOverride All
Order Deny,Allow
Deny from All
Allow from All
</Directory>
ErrorLog "logs/error-test1.log"
CustomLog "logs/access-test1.log" common
JkMount /* DLOG4J
JkUnMount /*.html DLOG4J
JkUnMount /*.htm DLOG4J
JkUnMount /*.jpg DLOG4J
JkUnMount /*.gif DLOG4J
JkUnMount /*.css DLOG4J
JkUnMount /*.js DLOG4J
</VirtualHost>
D:\Tomcat6\conf\server.xml
================================================<Host name="www.test1.com" debug="0" appBase="D:\Tomcat6\webapps" unpackWARs="true" autoDeploy="true">
<Context path="" docBase="test" privileged="true" autoDeploy="true"></Context>
</Host>
去掉TOMCAT的虚拟主机配置,就无法正常访问到D:\Tomcat6\webapps\test项目,只能访问TOMCAT管理页。
为什么APACHE配置了虚拟主机
TOMCAT还得再配置虚拟主机 才可以连接上?只配置APACHE虚拟主机相关路径,域名总是访问TOMCAT管理页面??D:\Apache2.2\conf\extra\httpd-vhosts.conf
===============================================<VirtualHost *:80>
ServerName www.test1.com
ServerAlias test1.com
DocumentRoot "D:/Tomcat6/webapps/test"
<Directory "D:/Tomcat6/webapps/test">
AllowOverride All
Order Deny,Allow
Deny from All
Allow from All
</Directory>
ErrorLog "logs/error-test1.log"
CustomLog "logs/access-test1.log" common
JkMount /* DLOG4J
JkUnMount /*.html DLOG4J
JkUnMount /*.htm DLOG4J
JkUnMount /*.jpg DLOG4J
JkUnMount /*.gif DLOG4J
JkUnMount /*.css DLOG4J
JkUnMount /*.js DLOG4J
</VirtualHost>
D:\Tomcat6\conf\server.xml
================================================<Host name="www.test1.com" debug="0" appBase="D:\Tomcat6\webapps" unpackWARs="true" autoDeploy="true">
<Context path="" docBase="test" privileged="true" autoDeploy="true"></Context>
</Host>
去掉TOMCAT的虚拟主机配置,就无法正常访问到D:\Tomcat6\webapps\test项目,只能访问TOMCAT管理页。
你这行把所有访问都交给tomcat处理了.
tomcat中如果没配置你的应用,当然是得到默认应用的结果了。