Tomcat Deployment Web project "Go"

Source: Internet
Author: User

Before you proceed, look at the directory structure of Tomcat.

(For Tomcat 6.0,tomcat7.0)

There are 7 directories under Tomcat, each of which is the Bin,conf,lib,logs,temp,webapps,work directory, which is now described in each directory.

The Tomcat root directory is called <catalina_home&gt in Tomcat;

1.<catalina_home>/bin: A script file that launches and shuts down Tomcat under various platforms.

2.<catalina_home>/lib: The Lib directory in the Lib directory, which holds the jar that the Tomcat server and all Web applications can access.
3.<catalina_home>/work:tomcat places the various servlet files generated by the JSP into this directory.
4.<catalina_home>/temp: Temporary binder, which is used by Tomcat to store temporary files during runtime.
5.<catalina_home>/logs: A log file that holds tomcat.
6.<catalina_home>/conf:tomcat of the various configuration files, the most important is the server.xml.

7.<catalina_home>/webapps:tomcat's main Web publishing directory, by default, places Web application files in this directory.



1.war Package Deployment:

Make the Web app you want to publish into a war file, (for example: Root.war), copy it to <catalina_home>/webapps,

Start Tomcat,

If it is root.war, it can be accessed directly through http://ip:port/

If it is Xxxx.war, you can access it via http://ip:port/xxxx/



2. Directory Deployment:

Deploy a JSP application by creating a new context in Server.xml.

Open the <catalina_home>/conf/server.xml file and create a context within the host tag, as follows. :
<context path= "/xxxx" reloadable= "true" docbase= "D:\myapp" workdir= "D:\myapp\work"/>
Where path is the virtual path, Docbase is the physical path to the JSP application, and Workdir is the working directory of the application, which stores the files that are generated for this application.

Launch Tomcat, accessible via http://ip:port/xxxx/



3. Redirect the directory for the Web application:

If you want to run more than one Tomcat instance on the server, a common Tomcat distribution file

Or if you want to overwrite the original configuration file while upgrading Tomcat, without affecting the existing Web application,

Then the "Directory of redirected Web applications" approach to deployment is a good choice.



If the Tomcat distribution installation path is:/opt/tomcat/,

The web app is named Aubapp,

Create a directory under/srv/Aubapp

Create a directory under/srv/aubapp/webapps,work,temp,conf

Copy all the contents under the/opt/tomcat/conf/to/srv/aubapp/conf/,



Using scenario 1, copy the war package to/srv/aubapp/webapps/,

or Scenario 2, modify the/srv/aubapp/conf/server.xml file to make the application path



Write a startup script start.sh, I'm used to putting it under/srv/aubapp/bin/

shell code  &NBSP; :

1#!/bin/SH2 #设置web应用程序目录3Export catalina_base= "/srv/aubapp"4 #设置Tomcat发行版安装目录5Export Catalina_home= "/opt/tomcat"6 #后台启动Tomcat, and redirect the console log7Nohup sh/opt/tomcat/bin/catalina.sh Run, ... /logs/tomcat.log 0</dev/NULL2>&1 &8 9#!/bin/SHTen #设置web应用程序目录 OneExport catalina_base= "/srv/aubapp" A #设置Tomcat发行版安装目录 -Export Catalina_home= "/opt/tomcat" - #后台启动Tomcat, and redirect the console log theNohup sh/opt/tomcat/bin/catalina.sh Run, ... /logs/tomcat.log 0</dev/NULL2>&1 & After startup, Access is the same as war package deployment and directory deployment.

"Reprint" http://wy649898543.iteye.com/blog/1442578

&NBSP;

Tomcat Deployment Web project "Go"

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.