Apache与Tomcat整合问题,大家大家帮帮忙!
今天刚将Apache与Tomcat整合起来,但在调试的时候发现一个问题,百思不得其解,求高手帮忙.如下:
我在apache的配置文件中已经指定如下虚拟目录:
<VirtualHost *:80>
ServerAdmin 123@163.com
DocumentRoot "C:/Tomcat4/webapps/myapp"
ServerName 192.168.0.1
ErrorLog logs/my-error.log
CustomLog logs/my-access.log common
</VirtualHost>
也就是说我已经将默认路径指向myapp目录不是ROOT目录,并且在DirectoryIndex中也配置了默认文件如下:
DirectoryIndex index.html index.html.var index.jsp
myapp目录下的index.jsp和ROOT目录下的index.jsp(是一个有猫的页面)是两个完全不同的文件
但我在浏览器中输入http://192.168.0.1的时候它却显示有猫的ROOT目录下的index.jsp,而不是myapp目录下的index.jsp,当我将myapp目录下的index.jsp文件改成index.html时又能正确显示,于是我怀疑是不是tomcat/conf下的web.xml的设置有问题于是我将web.xml下的<welcome-file-list>下的index.html,index.htm全部去掉,只留下index.jsp,重新启动后,在浏览器中输入http://192.168.0.1,它依然显示ROOT目录下的index.jsp,而不是myapp目录下的index.jsp,真是郁闷大家帮帮忙啊!