1. 安裝java開(kāi)發(fā)環(huán)境JDK
根據(jù)自己系統(tǒng)的版本選擇合適的JDK RPM安裝包
因?yàn)镽PM默認(rèn)已經(jīng)設(shè)置好java相關(guān)的環(huán)境變量,可以節(jié)省很多不必要的錯(cuò)誤
RPM包安裝完默認(rèn)路徑為/usr/java
JDK下載官網(wǎng):
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官方網(wǎng)站下載二進(jìn)制安裝包:
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
啟動(dòng)tomcat
[root@linux1 ~]#/usr/local/tomcat/bin/catalina.sh start
查看是否為安全啟動(dòng):
[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配置文件詳解
轉(zhuǎn)載:http://www.blogjava.net/baoyaer/articles/107278.html