操作环境
服务器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
启动并且开放tomcat访问端口
1,启动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,开启端口
tomcat默认访问是8080端口,所以我们要开启8080端口,如果服务器有安全组还要去安全组上面开放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,检验tomcat是否正常安装运行
通过以下地址查看tomcat是否运行正常:
http://116.196.65.198:8080/
看到tomcat系统界面,说明安装成功!
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