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 "%r"%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