Tomcat Settings homepage (Linux system)

Source: Internet
Author: User

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)

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.