Original http://www.codesec.net/view/401617.html
1.tomcat the original default root directory is http://localhost:8080, if you want to modify the root directory of access, you can:
Locate the Tomcat Server.xml (under the Conf directory) and find:
Copy the code code as follows:
Unpackwars= "true" autodeploy= "true"
Xmlvalidation= "false" Xmlnamespaceaware= "false" ></Host>
Insert before </Host>:
Copy the code code as follows:
<context path= "" docbase= "d:/eclipse3.3/jb51.net/tomcat/" debug= "0"/>
Where d:/eclipse3.3/jb51.net/tomcat/is the Web root directory that I want to set up, and then reboot Tomcat.
When you visit http://localhost:8080 again, you are directly accessing the files in the d:/eclipse3.3/jb51.net/tomcat/directory.
2.tomcat Web. XML (in the Conf directory), found in the file
Copy the code code as follows:
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
This is the default 3 files for Tomcat, and when you enter a specified path, Tomcat will automatically find the 3 pages. If you want Tomcat to automatically find its own page, such as main.jsp. The above information can be modified to:
Copy the code code as follows:
<welcome-file-list>
<welcome-file>main.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
That's all you can do.
Change the site root directory in Tomcat