CentOS7.0 install and configure Tomcat-7

Source: Internet
Author: User
Installation Instructions installation environment: CentOS-7.0.1406 installation method: Source code installation software: apache-tomcat-7.0.29.tar.gz: License

Installation Instructions
Installation environment: CentOS-7.0.1406
Installation method: Source code installation
Software: apache-tomcat-7.0.29.tar.gz
: Http://tomcat.apache.org/download-70.cgi
Prerequisites 
The system must have JDK6 + installed, see install and configure the CentOS-6.3 in the JDK-7.
Install tomcat
Upload the apache-tomcat-7.0.29.tar.gz file to/usr/local and perform the following operations:

The code is as follows: [Plain]View plaincopyprint?
  1. [Root @ admin local] # cd/usr/local
  2. [Root @ admin local] # wget http://apache.fayea.com/apache-mirror/tomcat/tomcat-7/v7.0.57/bin/apache-tomcat-7.0.57.tar.gz
  3. [Root @ admin local] # tar-zxv-f apache-tomcat-7.0.29.tar.gz // Unzip the package
  4. [Root @ admin local] # rm-rf apache-tomcat-7.0.29.tar.gz // delete compressed package
  5. [Root @ admin local] # mv apache-tomcat-7.0.29 tomcat

Start Tomcat

Perform the following operations:

The code is as follows:
[Plain]View plaincopyprint?
  1. [Root @ admin ~] #/Usr/local/tomcat/bin/startup. sh // start tomcat
  2. Using CATALINA_BASE:/usr/local/tomcat
  3. Using CATALINA_HOME:/usr/local/tomcat
  4. Using CATALINA_TMPDIR:/usr/local/tomcat/temp
  5. Using JRE_HOME:/usr/java/jdk1.7.0/jre
  6. Using CLASSPATH:/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/tomcat-juli.jar

The above information indicates that the instance has been started successfully.

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

[Plain]View plaincopyprint?
  1. [Root @ admin ~] # Vi +/etc/sysconfig/iptables

# Add the following code

[Plain]View plaincopyprint?
  1. -A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 8080-j ACCEPT

Restart firewall

[Plain]View plaincopyprint?
  1. [Root @ admin java] # service iptables restart

Verify Tomcat installation and running

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

Stop Tomcat

[Plain]View plaincopyprint?
  1. [Root @ admin ~] #/Usr/local/tomcat/bin/shutdown. sh // stop tomcat

Related Article

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.