centos6.7安装tomcat
Posted 扰扰
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos6.7安装tomcat相关的知识,希望对你有一定的参考价值。
一、配置环境
安装环境: centos6.7 jdk1.8.0 tomcat8.5
1、到官网下载tomcat
二、下载安装tomcat
1、通过xsheel工具rz命令上传tomcat安装包到centos系统(安装lrzsz命令 # yum -y install lrzsz)
2、解压安装包 tar -xzvf apache-tomcat-8.5.32.tar.gz
三、运行配置tomcat
1、跳转到tomcat目录下的bin目录下,执行./startup.sh启动服务
2、在防火墙中打开8080端口:firewall-cmd –zone=public –add-port=8080/tcp –permanent
3、重启防火墙 :systemctl restart firewalld.service
4、远程访问即可:http://IP地址:8080/
四、设置服务开机启动
1、vim /etc/init.d/tomcat
#!/bin/bash # # tomcat startup script for the Tomcat server # # chkconfig: 345 80 20 # description: start the tomcat deamon # # Source function library . /etc/rc.d/init.d/functions prog=tomcat JAVA_HOME=/usr/local/java/jdk1.8.0_171 export JAVA_HOME CATALANA_HOME=/usr/local/apache-tomcat-8.5.32/ export CATALINA_HOME case "$1" in start) echo "Starting Tomcat..." $CATALANA_HOME/bin/startup.sh ;; stop) echo "Stopping Tomcat..." $CATALANA_HOME/bin/shutdown.sh ;; restart) echo "Stopping Tomcat..." $CATALANA_HOME/bin/shutdown.sh sleep 2 echo echo "Starting Tomcat..." $CATALANA_HOME/bin/startup.sh ;; *) echo "Usage: $prog {start|stop|restart}" ;; esac exit 0
2、配置
chmod +x /etc/init.d/tomcat
chkconfig tomcat on
service tomcat start
以上是关于centos6.7安装tomcat的主要内容,如果未能解决你的问题,请参考以下文章
Centos下安装部署gisserver及centos6-7中文乱码解决