linux安装tomcat8

1.官网下载tomcat8

网址:https://tomcat.apache.org/download-80.cgi

2.上传到服务器目录下

tar -zxvf apache-tomcat-8.5.29.tar.gz

将解压文件移动到/usr/local/tomcat/中: 

mv apache-tomcat-8.5.29 /user/local/tomcat/

3. 配置环境变量,内存。修改bin下的catalina.sh

    添加在# OS specific support. $var _must_ be set to either true or false.这一行下面:

JAVA_OPTS="-Xms512m -Xmx1024m -Xss1024K -XX:PermSize=512m -XX:MaxPermSize=1024m"

export TOMCAT_HOME=/usr/local/tomcat/apache-tomcat-8.5.29

export CATALINA_HOME=/usr/local/tomcat/apache-tomcat-8.5.29/

export JRE_HOME=/usr/java/jdk1.8.0_161/jre

export JAVA_HOME=/usr/java/jdk1.8.0_161

4.修改端口

vi /usr/local/tomcat/apache-tomcat-8.5.29/conf/server.xml

找到 Connector port="8080" ,修改成想要的端口并保存

5.启动tomcat

/usr/local/tomcat/apache-tomcat-8.5.29/bin/startup.sh

6.关闭tomcat

./shutdown.sh

7.配置防火墙

firewall-cmd --zone=public --add-port=80/tcp --permanent

firewall-cmd --reload

firewall-cmd --zone=public --list-ports

你可能感兴趣的:(linux安装tomcat8)