操作環(huán)境
服務(wù)器centos7.3
下載安裝
1星岗,下載tomcat安裝包
[root@jdu4e00u53f7 frank]# mkdir tomcat
[root@jdu4e00u53f7 frank]# ls
java redis ruby tomcat
[root@jdu4e00u53f7 frank]# cd tomcat/
[root@jdu4e00u53f7 tomcat]# wget http://mirrors.shuosc.org/apache/tomcat/tomcat-8/v8.5.20/bin/apache-tomcat-8.5.20.tar.gz
2溶握,解壓安裝
[root@jdu4e00u53f7 tomcat]# tar -zxvf apache-tomcat-8.5.20.tar.gz
啟動(dòng)并且開(kāi)放tomcat訪(fǎng)問(wèn)端口
1,啟動(dòng)tomcat
[root@jdu4e00u53f7 bin]# /tmp/frank/tomcat/apache-tomcat-8.5.20/bin/startup.sh
Using CATALINA_BASE: /tmp/frank/tomcat/apache-tomcat-8.5.20
Using CATALINA_HOME: /tmp/frank/tomcat/apache-tomcat-8.5.20
Using CATALINA_TMPDIR: /tmp/frank/tomcat/apache-tomcat-8.5.20/temp
Using JRE_HOME: /tmp/frank/java/jdk1.8.0_144/jre
Using CLASSPATH: /tmp/frank/tomcat/apache-tomcat-8.5.20/bin/bootstrap.jar:/tmp/frank/tomcat/apache-tomcat-8.5.20/bin/tomcat-juli.jar
Tomcat started.
2晨炕,開(kāi)啟端口
tomcat默認(rèn)訪(fǎng)問(wèn)是8080端口,所以我們要開(kāi)啟8080端口毫炉,如果服務(wù)器有安全組還要去安全組上面開(kāi)放8080端口
[root@jdu4e00u53f7 conf]# systemctl start firewalld
[root@jdu4e00u53f7 conf]# firewall-cmd --zone=public --add-port=8080/tcp --permanent
success
[root@jdu4e00u53f7 conf]# firewall-cmd --reload
success
3瓮栗,檢驗(yàn)tomcat是否正常安裝運(yùn)行
通過(guò)以下地址查看tomcat是否運(yùn)行正常:
http://116.196.65.198:8080/
看到tomcat系統(tǒng)界面,說(shuō)明安裝成功瞄勾!
4费奸, 停止Tomcat
[root@jdu4e00u53f7 conf]# /tmp/frank/tomcat/apache-tomcat-8.5.20/bin/shutdown.sh
Using CATALINA_BASE: /tmp/frank/tomcat/apache-tomcat-8.5.20
Using CATALINA_HOME: /tmp/frank/tomcat/apache-tomcat-8.5.20
Using CATALINA_TMPDIR: /tmp/frank/tomcat/apache-tomcat-8.5.20/temp
Using JRE_HOME: /tmp/frank/java/jdk1.8.0_144/jre
Using CLASSPATH: /tmp/frank/tomcat/apache-tomcat-8.5.20/bin/bootstrap.jar:/tmp/frank/tomcat/apache-tomcat-8.5.20/bin/tomcat-juli.jar