修改tomcat默认主页
修改tomcat安装目录下bin/server.xml配置文件<host>标签
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
在<host>标签下加<Context>标签
<Context path="" docBase="项目名" reloadable="true" debug="0" privileged="true"></Context >
具体如下
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="" docBase="项目名" reloadable="true" debug="0" privileged="true"></Context >
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
这样重启后再次访问就会默认访问你配置的项目。
如何配置默认访问的页面呢?
修改tomcat安装目录下bin/web.xml配置文件<welcome-file-list>标签,把你默认的页面名称配置在第一位。
<welcome-file-list>
<welcome-file>默认页面.html</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>