steps: 1, open Server.xml, on the </Host> on the previous line to add content format as follows
<context path= "" reloadable= "true" docbase= "< project name >"/>
Such as:
<context path= "" docbase= "GPs" debug= "0" reloadable= "true"/>
Dosbase wrote the name you want to set as the default item.
another:If you want to enter only IP or domain name, then the Tomcat port is set to 80 (but you need to confirm that there are other programs to occupy the port), modify the following:
<connector port= "8192" maxhttpheadersize= "
maxthreads= "minsparethreads=" maxsparethreads= "75"
Enablelookups= "false" redirectport= "8443" acceptcount= "100"
connectiontimeout= "20000" disableuploadtimeout= "true"/>
Note: One of the problems with the above settings is that the item will be loaded repeatedly two times.
Cause Analysis
Unpackwars= "true" autodeploy= "true"
Xmlvalidation= "false" Xmlnamespaceaware= "false" >
<context path= "" docbase= "GPs" reloadable= "true"/>
1. When the AppBase property is set for the Host container, Tomcat automatically loads all legitimate works under the AppBase specified directory at startup;
2. The designated GPS project is also loaded once, because the Tomcat default project is also set through the Docbase property of the context.
Based on the above two points, caused the repeated loading of the GPS project.
Solutions
1. Create a new directory dedicated to the storage of engineering, such as: G:\apache-tomcat-6.0.20\project
2. The project is deposited in the above directory: namely: G:\apache-tomcat-6.0.20\project\gps
3. Set the DocBase property in the context container, such as:
<context path= "" docbase= "G:\apache-tomcat-6.0.20\project\gps"/>
To resolve this issue, restart the Tomcat server to access this project by not adding a project name.
Note: Remember to delete the original item in the WebApps directory
----------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- ----------------------------------
When you deploy a project to a Tomcat server, you can set the default access path, and in several cases you can set:
1, access to the IP default open project, the path shown is only IP
Implementation one: Publish the project to the root directory under Tomcat webapp (tomcat/webapp/root), delete the default file under root, and copy the project file to this directory. This is deployed in the root directory and the path to access is: IP.
Implementation mode Two: The project is published under the root sibling directory, modify the profile server.xml (tomcat/conf/server.xml), open the file, locate <Host> node, add <context path= "" Docbase= "project name" debug= "0" reloadable= "true"/>, at which point the project is not published in the root directory, but the access path is also IP.
2, access the IP default open project, the path shown is ip/project name
Specific actions:
Delete all of the original files, and then copy the items you want to assign to the root sibling directory.
Delete the file under root and create a new JSP file index.jsp. The contents are:
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
Then modify the Web.xml file in the Web-inf folder and add the following statement to the file: <welcome-file-list>
<welcome-file>index.jsp//This is the default open page </welcome-file>
</welcome-file-list>
After such modifications, you can then directly open the specified item or page by entering http://localhost/or (HTTP://IP address: 8080/) directly in the address bar.
Note: When modifying the Web.xml file, use the EditPlus, when the modification produces a Web.xml.bak file, the file is web.xml backup file, the suffix can be modified to use directly. This backup file is editplus automatically generated, if you do not want it to automatically generate backup files can be modified as follows: Editplus-tool-"Parameters-" file (file root)-"Save the file when creating a backup hook remove