Install Tomcat 8 in CentOS

Source: Internet
Author: User

Install Tomcat 8 in CentOS

Install Tomcat 8

  1. Go to renewal.

  2. Put the apache-tomcat-8.0.26.tar.gz file in the/usr/local directory and execute the following script:

  3. #cd/usr/localUnzip tar-zxvfapache-tomcat-8.0.26.tar.gz // decompress the compressed package#Rm-rfapache-tomcat-8.0.26.tar.gz.tar.gz // Delete the compressed package#mvapache-tomcat-8.0.26tomcat

Start Tomcat8

#/Usr/local/tomcat/bin/startup. sh // start tomcat


Using CATALINA_BASE:/usr/local/tomcat
Using CATALINA_HOME:/usr/local/tomcat
Using CATALINA_TMPDIR:/usr/local/tomcat/temp
Using JRE_HOME:/usr/java/jdk1.8.0 _ 60
Using CLASSPATH:/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.


If the following error occurs:

Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program

You must set the java path in advance.

Add the following content to apache-tomcat-8.0.26/bin/setclasspath. sh:

exportJAVA_HOME=/usr/java/jdk1.8.0_60exportJRE_HOME=/usr/java/jdk1.8.0_60/jreexportCLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATHexportPATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

Open firewall port 8080

Add port 8080 to the firewall configuration and perform the following operations:

#vi/etc/sysconfig/iptables


# Add the following code

-ARH-Firewall-1-INPUT-mstate--stateNEW-mtcp-ptcp--dport8080-jACCEPT

Restart Firewall

#serviceiptablesrestart

Verify the installation and running of Tomcat8

Check whether tomcat is running properly at the following address:
Http: // 192.168.11.52: 8080/
The tomcat System Interface is displayed, indicating that the installation is successful!

Stop Tomcat8

#/Usr/local/tomcat/bin/shutdown. sh // stop tomcat

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.