一、下载 apache-tomcat-8.5.43.tar.gz
wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.5.43/bin/apache-tomcat-8.5.43.tar.gz
二、解压到指定目录
tar zxvf apache-tomcat-8.5.43.tar.gz -C 目录名
三、防火墙开启 8080 端口
# --permanent永久生效,没有此参数重启后失效
firewall-cmd --zone=public --add-port=8080/tcp --permanent
# 重新载入防火墙
firewall-cmd --reload
四、配置 Manager
编辑 apache-tomcat-8.5.43/conf/tomcat-users.xml
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="tomcat" password="tomcat" roles="manager-gui,manager-script,manager-jmx,manager-status"/>
编辑 apache-tomcat-8.5.43/webapps/manager/META-INF/context.xml,允许任意 IP 访问
<?xml version="1.0" encoding="UTF-8"?>
<Context antiResourceLocking="false" privileged="true" >
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />
<Manager sessionAttributeValueClassNameFilter="java.lang.(?:Boolean|Integer|Long|Number|String)|org.apache.catalina.filters.CsrfPreventionFilter$LruCache(?:$1)?|java.util.(?:Linked)?HashMap"/>
</Context>
访问 http://ip:端口/manager/html 进入 manager 页面