First, modify the port
Open the Server.xml file under the Conf folder of the Tomcat installation directory, and locate the connector label for http/1.1 protocol to 80 (the default is 8080):
<port= " protocol"= "http/1.1" connectiontimeout = "20000" Redirectport = "8443" />
Description
If you use the default of 8080, you must specify 8080 ports at the back of the domain to access it, you need to access it like this:
http://www.xxx.com:8080/
After changing to the default port of 80, the access is:
http://www.xxx.com/
Second, point to the home page file directory
The Docbase attribute of the context tag is changed to the path of the home page file (seemingly homepage can not add/, otherwise it is not accessible):
<Hostname= "localhost"AppBase= "WebApps"Unpackwars= "true"Autodeploy= "true"> <ContextDocBase= "/home/tomcat/apache-tomcat/webapps/homepage"Path=""reloadable= "true"/></Host>
Description
Before the curiosity to change the name property of the host tag, the results of two days have been visited the site 404, find a long reason to find this is can not be casually changed _ (: Зゝ∠) _
How to use it is not clear, but for the moment it is clear that the Docbase property under the Context tab is used to set the actual path of the project, and the Path property is to define a virtual path.
For example, the actual path is/home/tomcat/apache-tomcat/webapps/info, the virtual path is MyInfo, then you can access the contents of this folder through Http://www.xxx.com/myinfo.
Tomcat Settings homepage (Linux system)