配置默認(rèn)app
訪問tomcat下的應(yīng)用得加上項(xiàng)目名,比如http://127.0.0.1:8080/elastic/index.html。
配置好默認(rèn)應(yīng)用之后只需http://127.0.0.1:8080/index.html即可。
配置方法
第一種
配置server.xml。
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
<Context docBase="D:\apache-tomcat-7.0.72\webapps\webproject1" path="/" />
</Host>
第二種
在${CATALINA_HOME}/conf/Catalina/localhost/下添加ROOT.xml,內(nèi)容如下:
<?xml version="1.0" encoding="UTF-8">
<Context docBase="D:\apache-tomcat-7.0.72\webapps\webproject1" />
如果ROOT.xm為myApp.xml,則需要通過http://127.0.0.1:8080/myApp/index.html訪問。