1. 安装java开发环境JDK
根据自己系统的版本选择合适的JDK RPM安装包
因为RPM默认已经设置好java相关的环境变量,可以节省很多不必要的错误
RPM包安装完默认路径为/usr/java
JDK下载官网:
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
[root@linux1 ~]# yum install wget -y
[root@linux1 ~]# wget http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64.rpm?AuthParam=1480483000_0ae69c584b923f9375e91ac5b73a645f
[root@linux1 ~]# yum install jdk-8u111-linux-x64.rpm -y
判断是否安装成功
[root@linux1 ~]# java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
2. 安装apache-tomcat
在tomcat官方网站下载二进制安装包:
http://tomcat.apache.org/
[root@linux1 ~]# tar zxvf apache-tomcat-7.0.73.tar.gz
[root@linux1 ~]# mv apache-tomcat-7.0.73 /usr/local/tomcat
启动tomcat
[root@linux1 ~]#/usr/local/tomcat/bin/catalina.sh start
查看是否为安全启动:
[root@linux1 ~]# netstat -lntup | grep 8080
tcp 0 0 :::8080 :::* LISTEN 1662/java
[root@linux1 ~]# ps -ef | grep tomcat
root 1662 1 1 00:33 pts/1 00:00:08 /usr/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -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 1723 1404 0 00:43 pts/1 00:00:00 grep tomcat
3. 登陆localhos:8080查看
4. tomcat配置文件详解