Tomcat Deployment Web Project

Source: Internet
Author: User
Tags tomcat apache tomcat
1 cmd build tomcat service

CD E:\Program Files (x86) \tomcat61\bin
E: (Switch directory)
Service Install tomcat61 (new service) (Apache Tomcat in front of the services name)
Service Remove tomcat61 (uninstall services)

Startup.bat (Start service)

Shutdown.bat (Turn off service)

net start tomcat61 not start the service, the error is as follows (this problem remains to be resolved)

2 Configuring the Tomcat Manage user account

Add the Tomcat-users.xml in the Conf folder:

<role rolename= "Manager-gui"/>
<user username= "Tomcat" password= "Tomcat" roles= "Manager-gui"/>

Visit http://127.0.0.1:8180/, click Left

Enter and enter the configured account tomcat, password Tomcat 3 JDK comes with monitoring tools

Jvisualvm.exe under the bin

4 Tomcat Deployment Web project 4.1 Using Tomcat to deploy automatically

Copy the application to Tomcat's WebApps path, and Tomcat will load automatically when it starts.

The test folder is a compiled test project with http://127.0.0.1:8180/Test/access 4.2 To modify the Server.xml file deployment

New E:\Program Files (x86) \project, put the above Test folder in Project,

Open Tomcat's configuration file in Conf/server.xml with UE or EditPlus, and find the following:
XML code

 

Add the following between host:
XML code

<context path= "/test2" reloadable= "true" docbase= "E:\\program Files (x86) \\project\\Test" workdir= "E:\\program Files (x86) \\project\\temp "/>  

Path: Represents the route of the access, as in the above example, access to the application is: http://127.0.0.1:8180/Test2/(path can be arbitrarily modified)
Reloadable: Indicates that the class pack can be loaded automatically at run time under the classes and Lib folders
Docbase: Represents the address of the application, note the direction of the slash "\" or "/"
Workdir: Represents the drop address of the cache file

Note: Multiple tomcat clusters of the same server can share E:\Program files (x86) \project\test file 4.3 to add custom Web Deployment files (no need to restart Tomcat)

In the Tomcat installation directory Conf/catalina/localhost, create a new XML file in the directory, the name can not be arbitrarily taken, and the name after the path of the same, according to the following path configuration, The name of the XML should be test (test.xml)
XML code

<context path= "/test" docbase= "E:\\program Files (x86) \\project\\Test"  debug= "0" privileged= "true" reloadable = "true" >     
</Context> (in fact the same as the second way)

Once deployed, you can access it via http://127.0.0.1:8180/test/

Reference: http://blog.sina.com.cn/s/blog_7ba68f520100pnzl.html
http://blog.csdn.net/diamondy/article/details/7472411 4.4 Note

Deleting a web app also deletes the corresponding context in the corresponding folder and Server.xml under WebApps, and also deletes the corresponding XML file in the Tomcat Conf\catalina\localhost directory. Otherwise Tomcat will still go to configure and load

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.