tomcat 手动安装进入管理界面

1. 下载 Tomcat 9(你可以根据需要替换为最新版本)

cd /opt
# 自行查找合适的版本
wget https://downloads.apache.org/tomcat/tomcat-9/v9.0.85/bin/apache-tomcat-9.0.85.tar.gz

2. 解压

tar -xzf apache-tomcat-9.0.85.tar.gz
mv apache-tomcat-9.0.85 tomcat9

3. 给予执行权限

chmod +x /opt/tomcat9/bin/*.sh

4. 启动 Tomcat

/opt/tomcat9/bin/startup.sh

进入管理界面需要配置--IP限制

/opt/tomcat9/webapps/manager/META-INF/context.xml

<Context antiResourceLocking="false" privileged="true" >
  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="127\.\d+\.\d+\.\d+|::1" />
</Context>

用户设置

conf/tomcat-users.xml

<tomcat-users xmlns="http://tomcat.apache.org/xml"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
              version="1.0">
  <role rolename="manager-gui"/>
  <role rolename="admin-gui"/>
  <user username="admin" password="admin123" roles="manager-gui,admin-gui"/>
</tomcat-users>
posted @ 2025-04-15 19:11  那时一个人  阅读(56)  评论(0)    收藏  举报