Changing the tomcat default directory + port + setting Default Web page method

Source: Internet
Author: User

I built a myjsp directory under $tomcat/webapps/as the default directory for my site, there is a a.jsp file in myjsp, which is the default home page for my site.
To modify a configuration file:
First, modify the $tomcat/conf/server.xml file. In the Server.xml file, there is a section as follows: ...
<engine name= "Catalina" defaulthost= "localhost" > Xmlvalidation= "false" Xmlnamespaceaware= "false" > ... To add between <context path= "" docbase= "myjsp" debug= "0" reloadable= "true"/>
Path is the name of the virtual directory, if you want to enter only the IP address to display the home page, the key value is left blank;
Docbase is the path to the virtual directory, it defaults to the $tomcat/webapps/root directory, and now I have a myjsp directory under the WebApps directory, which is the default directory for my directory.
Debug and reloadable are generally set to 0 and true respectively.
Then, modify the $tomcat/conf/web.xml file. In the Web. xml file, there is a paragraph like this: <welcome-file-list>
<welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> &lt ;welcome-file>index.jsp</welcome-file> </welcome-file-list>
Add between <welcome-file-list> and <welcome-file>index.html</welcome-file>:
<welcome-file>a.jsp</welcome-file>
Change Port <connector
port= "8080"
Maxthreads= "minsparethreads=" 25 "
Maxsparethreads= "enablelookups=" false "redirectport=" 8443 "
acceptcount= "debug=" 0 "
connectiontimeout= "20000"
Disableuploadtimeout= "true"/>

Change port "8080" to your ports
After saving the two files above, restart Tomcat and enter "http://localhost:8080/" in the browser address bar to display the contents of the a.jsp page.

Changing the tomcat default directory + port + setting Default Web page method

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.