Tomcat default Access listening port is 8080, but in the URL bar input IP plus port unavoidably some trouble, and if the use of IP parsing, can only resolve to the corresponding IP, can not directly through the browser default 80 port access, So we can modify the Tomcat default listening port to 80, so that it can be easily accessed through the browser.
To modify the configuration file for the Tomcat default listener Port Conf/servel.xml in the Tomcat installation directory, locate the following section:
<connector port= "8080" protocol= "http/1.1" connectiontimeout= "20000"
redirectport= "8443"/>
after changing 8080 of them to 80, restart Tomcat.
It is still not convenient to use IP to access after the modification, and often a tomcat container typically runs several web projects, even if it is inconvenient to access with the same IP, the virtual host is used at this time.
the configuration file for the virtual host is also in $tomcat_home/conf/server.xml, where two Web projects are assumed, one for Web1 and one for WEB2. The engine tag in the configuration file is added as follows:
to be modified is the name in host and the Docbas in the context
where the name in the host tag is the domain name to be accessed, the path in the Docbase in the Context tab is the path to the item to be accessed, either with a relative path (to WebApps as the current path), or by using an absolute path, after configuration. You can access the corresponding project directly through the domain name.