Tomcat default App

Source: Internet
Author: User

When you deploy your app, you need to change the default port number and app so that someone else knows what type of server to use and attack.
There are several ways to deploy TOMCA, and here's a quick talk.
There are currently three ways to think:
First, add the Context
In the Tomcat configuration file, a Web application is a specific context that can be deployed by deploying a JSP application in a new context in Server.xml.
In Tomcat, add the <context path= "/hello" docbase= "d:\ workspace\hello\webroot" debug= "0" privileged= "true" ></Context>
Or
<context path= "/myapp" reloadable= "true" docbase= "D:\myapp" workdir= "D:\myapp\work"/>
Or
<context path= "/sms4" docbase= "D:\workspace\sms4\WebRoot"/>
Parameter description:
Pathis a virtual path;
DocBaseis the physical path of the application;
Workdiris the working directory of the application, storing the files generated by the runtime associated with this application;
Debugis to set the debug level, 0 to provide the least amount of information, 9 to provide the most information
PrivilegedSet to True to allow Tomcat Web apps to use the servlet within the container
reloadableIf true, Tomcat automatically detects changes in the application's/web-inf/lib and/web-inf/classes directories, automatically mounts new applications, and can change applications without restarting Tomcat for hot deployment
antiresourcelocking and AntijarlockingThe parameters that need to be configured during hot deployment, false by default to avoid updating a webapp, and sometimes Tomcat does not completely remove the old webapp, usually leaving a jar package under Web-inf/lib, which must be turned off before Tomcat can be deleted, which results in automatic deployment failure. Set to True,tomcat when the corresponding WebApp is run, the corresponding source files and jar files are copied to a temporary directory.
docBase better be a directory outside of Tomcat/webapps, or it is loaded two applications, one is the context path= "" Web-demo application, and the other is the context path= "Web-demo" application, although the two points to the same physical path. So, access to http://localhost:8080, access to Http://localhost:8080/web-demo, get the same home page, but in fact is Tomcat's 2 context of the response.

second, cover root
Copy the project to WebApps and change the project name to root and back up the original root.

third, modify the root directory index.jsp (not recommended, will expose the server default home)
Modify the index.jsp of the Tomcat root directory so that it loads the default application's homepage, so it should be modified as follows:
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title></title>
<meta http-equiv= "Refresh" content= "0; Url=<%=request.getcontextpath ()%>/web-demo/index.html ">
<body>
</body>

Tomcat default App

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.