[英]tomcat context defined in server.xml is not loading
I have a web application deployed on path 我在路径上部署了Web应用程序
/var/lib/tomcat6/webapps/abc/</code>
in server.xml
on path /etc/tomcat/server.xml
I have added following lines. 在路径
/etc/tomcat/server.xml
上的server.xml
,我添加了以下几行。
<Context docBase="/var/lib/tomcat6/webapps/abc/" path="/" reloadable="true"> <Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" maxActive="20" maxIdle="10" maxWait="10000" name="jdbc/abcDB" password="abc" type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/abc" username="abc"/> </Context>
inside the host tag. 在主机标签中。
When I restart tomcat and hit http://localhost:8080/
nothing appears but when I enter http://localhost:8080/abc
home page is displayed which means above entry in server.xml
is not taking affect. 当我重新启动tomcat并单击
http://localhost:8080/
什么都没出现,但是当我输入http://localhost:8080/abc
主页时,这表明server.xml
上述输入未server.xml
。
What am I doing wrong ?? 我究竟做错了什么 ??
Looks like you want to set webapp abc
as the default web app (ie access it directly via http://localhost:8080/ ), then give the path as ""
not "/" in Context
看起来您想将webapp
abc
设置为默认Web应用程序(即直接通过http:// localhost:8080 /对其进行访问 ),然后在Context
中将路径指定为""
而不是“ /”
From the Tomcat docs, 从Tomcat文档中,
If you specify a context path of an empty string (""), you are defining the default web application for this Host, which will process all requests not assigned to other Contexts
如果您指定一个空字符串(“”)的上下文路径,那么您正在为此主机定义默认的Web应用程序,它将处理所有未分配给其他上下文的请求
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.