如何设置tomcat的默认访问路径

网上找了很多的资料,大部分的方法都是在<Host>与</Host>标签之间加入下面这个配置:

 <Context path=”" docBase=”/home/tomcat/javapage” debug=”0″ reloadable=”true” />

但我改了之后一直报错!

stackoverflow的方法比较靠谱:

原文:http://stackoverflow.com/questions/715506/tomcat-6-how-to-change-the-root-application

我是用下面这个方法解决的:

I've got a problem when configured Tomcat' server.xml and added Context element. He just doesn't want to use my config:http://www.oreillynet.com/onjava/blog/2006/12/configuration_antipatterns_tom.html

If you're in a Unix-like system:

  1. mv $CATALINA_HOME/webapps/ROOT $CATALINA_HOME/webapps/___ROOT
  2. ln -s $CATALINA_HOME/webapps/your_project $CATALINA_HOME/webapps/ROOT

Done.

Works for me.

你可能感兴趣的:(tomcat)