Tomcat Context configuration and Tomcat Context Configuration
Tomcat direct IP address access without adding a port or project name
After we develop a WEB project and deploy it to tomcat, we should normally access: http: // localhost: Port Number/Project Name
If we want users to only enter the domain name to access our project, we need to modify the Context settings of Tomcat.
Modify{TOMCAT_HOME}/conf/server. xmlFile
Open the server. xml file in the text editor.<Host>Add under Node<Context>Node, and setPath, docBase, reloadableAttribute
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Context path="/" docBase="/projectName" reloadable="false"/> </Host>
<Context> attributes of an element:
Path: Specifies the URL entry to access the Web application. Path = "/" or path = ""
DocBase: Specifies the file path of the Web application.Absolute pathYou can also specify the appBase attribute relative to the <Host>Relative Path,
If the Web application adopts an open directory structure, specify the root directory of the Web application. If the Web application is a war file, specify the path of the war file.
This can be the relative path: docBase = "/projectName" or absolute path: docBase = "D: \ tomcat \ webapps \ projectName"
Reloadable: If this property is set to true, the tomcat server will monitor changes to the class files in the WEB-INF/classes and WEB-INF/lib directories while running,
If a class file is detected to be modified, the server automatically reloads the Web application.
Author: itmyhome
Context configuration in serverxml in tomcat
It is generally not used. This is a "virtual directory ". If your project is on disk D and your Tomcat is on another place, you can add this project when you don't want to put it on Tomcat. DocBase = "d:/xx .." is the location of your current project. Struts in path = "/struts" is the name of the folder you use when accessing the browser.
How to configure Tomcat context in MyEclipse
You do not need to configure this tamcat. You have a user name and password. Go to C: \ Program Files \ Tomcat 6.0 \ conf. This is my installation path, you find the tomcat-users.xml file under this path to see what is the user name and password, open the home page Click tomcat manager enter the user name and password