Tomcat modifies 80-port monitoring and virtual host configuration

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.