1、系统环境
[root@test ~]# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core) [root@test ~]# uname -r 3.10.0-229.el7.x86_64
2、下载
wget http://mirrors.shu.edu.cn/apache/tomcat/tomcat-8/v8.5.31/bin/apache-tomcat-8.5.31-fulldocs.tar.gz
此版本为8.5.31,其他版本登陆官网下载
3、安装Tomcat8
tar -zxf apache-tomcat-8.5.31.tar.gz -C /usr/local/ ln -s /usr/local/apache-tomcat-8.5.31/ /usr/local/tomcat
4、设置java环境变量
vim /etc/profile JAVA_HOME=/usr/java/jdk PATH=$JAVA_HOME/bin:$PATH CLASSPATH=$JAVA_HOME/jre/lib/ext:$JAVA_HOME/lib/tools.jar export PATH JAVA_HOME CLASSPATH
5、启动Tomcat
[root@test tomcat]# /usr/local/java/bin/startup.sh Using CATALINA_BASE: /usr/local/tomcat Using CATALINA_HOME: /usr/local/tomcat Using CATALINA_TMPDIR: /usr/local/tomcat/temp Using JRE_HOME: /usr/java/jdk Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar Tomcat started.
6、停止Tomcat
[root@test ~]# /usr/local/tomcat/bin/shutdown.sh Using CATALINA_BASE: /usr/local/tomcat Using CATALINA_HOME: /usr/local/tomcat Using CATALINA_TMPDIR: /usr/local/tomcat/temp Using JRE_HOME: /usr/java/jdk Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
注意:
- 若开启防火墙,需要开放8080端口
- jdk环境变量设置
检验Tomcat安装运行
打开浏览器,输入tomcat服务器ip:8080 (http://192.168.0.1:8080) ,看到tomcat系统界面,说明安装成功!