Deploying a Tomcat project using Linux

Source: Internet
Author: User
Tags tomcat server apache tomcat

1. Download the corresponding Tomcat server package

Apache Tomcat official website Download: http://tomcat.apache.org/download-70.cgi

For example, we're using apache-tomcat-7.0.82.tar.gz:http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-7/v7.0.82/bin/. Apache-tomcat-7.0.82.tar.gz

2, upload to the Linux server and extract it

Use TAR-XZVF apache-tomcat-7.0.82.tar.gz command to extract after successful upload

Drwxr-xr-x 9 root root 4096 Nov 16:37 apache-tomcat-7.0.82-rw-r--r--1 root root 8997403 Nov 16:25 apache-tomcat-7. 0.82.tar.gz

3. Upload the War project package

After decompression, enter the Tomcat WebApps directory and upload the corresponding war project package.

[Email protected] tomcat]# CD apache-tomcat-7.0. the/webapps/[[email protected] webapps]# ll Total17116Drwxr-xr-x -Root root4096Nov the  -:Panax NotoginsengDocs drwxr-xr-x7Root root4096Nov the  -:Panax NotoginsengExamples Drwxr-xr-x5Root root4096Nov the  -:Panax NotoginsengHost-manager Drwxr-xr-x5Root root4096Nov the  -:Panax NotoginsengManager drwxr-xr-x3Root root4096Nov the  -:Panax NotoginsengROOT Drwxr-xr-x5Root root4096Nov the  -:xxyun-video-rw-r--r--1Root root17498127Nov the  -: $Yun-video.war [[Email protected] webapps]#

4. Modify the Tomcat-related server configuration file

[Email protected] webapps]# vim. /conf/server.xml

Modify the Tomcat boot port (default 8080):

<connector port= "8080" protocol= "http/1.1" connectiontimeout= "20000" redirectport= "8443"/> The port here can be modified to another service port , which is the boot port of Tomcat.

Modify the Tomcat root project to start

Configuration details: <context docbase= "${catalina.home}/webapps/need to start the root Project war package name, equal to the folder name after the war decompression" path= "" Sessioncookiename= " Session-sharing distinguished name "/>

After adding the configuration:

"localhost"Appbase="WebApps"unpackwars="true"autodeploy="true"> <context docbase="${catalina.home}/webapps/yun-video"Path=""Sessioncookiename="Yun-video"/> <!--Singlesignon valve, share authentication between Web applications documentation at:/docs/config/valve.html -<!--<valve Classname="Org.apache.catalina.authenticator.SingleSignOn"/>-<!--Access log processes all example. Documentation at:/docs/config/valve.html note:the pattern used isEquivalent tousingpattern="Common"-<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>

5. Start Tomcat

The script is in the bin directory.

[Email protected] bin]# sh startup.sh

6. Stop Tomcat

[Email protected] bin]# sh shutdown.sh

Deploying a Tomcat project using Linux

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.