One, Tomcat installation configuration
1. What is Tomcat
Tomcat is a software used to parse a JSP program, a Web container;
Tomcat is a core project of the Apache Software Foundation (Apache Software Foundation) Jakarta Project, developed by Apache, Sun, and other companies and individuals.
Tomcat is a lightweight application server that is widely used in small and medium-sized systems and concurrent access users, and is the first choice for developing and debugging JSP programs.
2. To run Tomcat, you must first install the JDK
Download the JDK on the official website to extract:
TAR-ZXVF jdk-8u31-linux-i586.tar.gz
MV Jdk1.8.0_31/usr/local/jdk1.8.0_31
vim/etc/profile.d/java.sh//Add local environment variables to the following configuration:
Java_home=/usr/local/jdk1.8.0_45
Java_bin=/usr/local/jdk1.8.0_45/bin
Jre_home=/usr/local/jdk1.8.0_45/jre
Path= $PATH:/usr/local/jdk1.8.0_45/bin:/usr/local/jdk1.8.0_45/jre/bin
classpath=/usr/local/jdk1.8.0_45/jre/lib:/usr/local/jdk1.8.0_45/lib:/usr/local/jdk1.8.0_45/jre/lib/ Charsets.jar
Let java.sh enter into force execution #. /etc/profile.d/java.sh
If the above configuration succeeds, the following command can see the Java version:
[Email protected] src]# java-version
Java Version "1.8.0_31"
Java (TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot (TM) Client VM (build 25.31-b07, Mixed mode)
3, install Tomcat, first to download, you can go to the official website to download the latest version
cd/usr/local/src/
wget http://apache.fayea.com/tomcat/tomcat-7/v7.0.62/bin/apache-tomcat-7.0.62.tar.gz
TAR-ZXVF apache-tomcat-7.0.62.tar.gz
MV Apache-tomcat-7.0.62/usr/local/tomcat
Cp-pv/usr/local/tomcat/bin/catalina.sh/etc/init.d/tomcat
"/usr/local/tomcat/bin/catalina.sh", "/etc/init.d/tomcat"
Vim/etc/init.d/tomcat//Join from second line
# chkconfig:2345 63 37
# Description:tomcat Server init script
# Source Function Library
. /etc/init.d/functions
Java_home=/usr/local/jdk1.8.0_45
Catalina_home=/usr/local/tomcat
4. Join the boot start
chmod 755/etc/init.d/tomcat
Chkconfig--add Tomcat
Chkconfig Tomcat on
Service Tomcat Start
PS aux |grep Tomcat
[[Email protected] src]# service Tomcat start
Using catalina_base:/usr/local/tomcat
Using Catalina_home:/usr/local/tomcat
Using Catalina_tmpdir:/usr/local/tomcat/temp
Using Jre_home:/usr/local/jdk1.8.0_31
Using CLASSPATH:/usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.
[[Email protected] src]# PS aux |grep Tomcat
Root 9324 48.2 3.6 332716 37312 pts/0 Sl 15:49 0:08/usr/local/jdk1.8.0_31/bin/java-djava.util.logging.confi G.file=/usr/local/tomcat/conf/logging.properties-djava.util.logging.manager= org.apache.juli.classloaderlogmanager-djava.endorsed.dirs=/usr/local/tomcat/endorsed-classpath/usr/local/ Tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar-dcatalina.base=/usr/local/tomcat-dcatalina.home =/usr/local/tomcat-djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap Start
Root 9337 0.0 0.0 5980 740 pts/0 s+ 15:49 0:00 grep Tomcat
Browser input http://ip:8080 can see Tomcat's welcome page, proving the configuration was successful
This article from "Bobcat" blog, reproduced please contact the author!
Tomcat installation Configuration