Installation and configuration of Tomcat on Linux

Source: Internet
Author: User

Installation and configuration of Tomcat on Linux

1.

JDK:

Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Tomcat:
Http://tomcat.apache.org/download-70.cg

2, JDK Installation and configuration. (RPM package)
(1) JDK installation
RPM Package:
# RPM-IVH jdk-7u79-linux-x64.rpm


tar.gz Package: Unzip
# Mkdir/usr/local/java
# Cd/usr/local/java
# tar-zxvf/software/jdk-7u79-linux-x64.tar.gz
Generate links for version upgrades
# ln-s jdk1.7.0_79 Latest
# ln-s Latest Default


(2) Configuring environment variables
# Vi/etc/profile
Export Java_home=/usr/local/java/default
Export java_bin= $JAVA _home/bin
Export path= $PATH: $JAVA _home/bin
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export path= $JAVA _home/bin: $JRE _home/bin: $PATH


Make configuration effective
# Source/etc/profile


test the JDK.
# java-version
Java Version "1.7.0_55"
Java (TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot (TM) 64-bit Server VM (build 24.55-b03, Mixed mode)

The following error resolution occurs when viewing the JDK:

3. Tomcat installation
Unzip
# Mkdir/usr/local/tomcat
# Cd/usr/local/tomcat
# tar-zxvf/software/apache-tomcat-7.0.70.tar.gz
Generate links for version upgrades
# ln-s apache-tomcat-7.0.70 Server


Start Tomcat
# Cd/usr/local/tomcat/server/bin
#./startup.sh
Using catalina_base:/usr/local/tomcat/server
Using Catalina_home:/usr/local/tomcat/server
Using Catalina_temdir:/usr/local/tomcat/server/temp
Using Jre_home:/usr/java/default
Using Class_path:/usr/local/tomcat/server/bin/bootstrap.jar:/usr/local/tomcat/server/bin/tomcat-juli.jar
Tomcat started.


4. Test Tomcat:
Open the firewall to allow external access(Under CENTOS6)
#/sbin/iptables-i input-p TCP--dport 8080-j ACCEPT
# Service Iptables Save
# Service Iptables Restart
or directly modify the file/etc/sysconfig/iptables.
# Vi/etc/sysconfig/iptables
-A input-p tcp-m tcp--dport 8080-j ACCEPT
# Service Iptables Restart

Open the firewall for external access (CENTOS7)

Firewall-cmd--permanent--zone=public--add-port=8080/tcp #添加端口

Firewall-cmd--reload #重新加载

Firewall-cmd--list-all #查看一下
In the browser input: http://192.168.170.128:8080
As can be entered in this machine: http://localhost:8080
The page that appears Tomcat indicates that the installation was successful.


Stop Tomcat
#./shutdown.sh

Installation and configuration of Tomcat on 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.