1.修改默认站点目录,修改server.xml,docs位于webapps中,workDir为绝对路径。默认为root。
2.修改默认访问文件,修改web.xml
3.修改默认端口8080,修改server.xml
4.修改Tomcat应用程序目录
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="docs" workDir="C:\Program Files\Apache Software Foundation\Tomcat 6.0\work" reload="true"
/>
</Host>
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="docs" workDir="C:\Program Files\Apache Software Foundation\Tomcat 6.0\work" reload="true"
/>
</Host>
2.修改默认访问文件,修改web.xml
<welcome-file-list>
<welcome-file>abc.html</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<welcome-file>abc.html</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
3.修改默认端口8080,修改server.xml
<Service name="Catalina">
<Connector port="8000" protocol="HTTP/1.1"
maxThreads="150" connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8000" protocol="HTTP/1.1"
maxThreads="150" connectionTimeout="20000"
redirectPort="8443" />
4.修改Tomcat应用程序目录
<Host name="localhost" debug="0" appBase="webapps" unpackWARs="true"
autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
// 修改成
<Host name="localhost" debug="0" appBase="mytest" unpackWARs="true"
autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
// mytest目录是和webapps在同一父目录下。
autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
// 修改成
<Host name="localhost" debug="0" appBase="mytest" unpackWARs="true"
autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
// mytest目录是和webapps在同一父目录下。