Tomcat removes the project name and port number

Source: Internet
Author: User

Initial access to local project input URL: Http://localhost:8080/LinkST

Change the Tomcat port number

The Tomcat port number defaults to 8080 and opens tomcat–>conf–> Server.xml server configuration file, directly search 8080, in 68 rows of connector, change port to the port you want to take, such as to remove the port number, directly change the port number to 80.

<Connector port="8080" protocol="HTTP/1.1"               connectionTimeout="20000"               redirectPort="8443" /><Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

Enter now: Http://localhost:80/LinkST or Http://localhost/LinkST can be accessed

To remove the Tomcat project name

Similarly, open the Tomcat–>conf–>server.xml server configuration file and locate the bottom of the configuration file in host.

 <Host name="localhost"appBase="WebApps"unpackwars= "true" Autodeploy="true">                       <!--can add code here --         <Valve className="Org.apache.catalina.valves.AccessLogValve" Directory ="Logs"prefix= "localhost_access_log" suffix=". txt " Pattern="%h%l%u%t &quot;%r&quot; %s%b " />                                    </Host>

In the code hint, add the following code, where Docbase is the project file you put in Tomcat, which is usually found in Tomcat–>webapp.

<Context docBase="D:\Java\Apache Software Foundation\Tomcat 8.0\webapps\LinkST

Enter now: http://localhost or Http://localhost/LinkST or Http://localhost:80/LinkST can be accessed

Success

Successful removal of Tomcat project name and port number: http://localhost

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Tomcat removes the project name and port number

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.