tomcat9安装教程
版本:9.0.52
1、下载
官网地址:https://tomcat.apache.org/download-90.cgi
https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-9/v9.0.52/bin/apache-tomcat-9.0.52.tar.gz
2、安装
tar -xzf apache-tomcat-9.0.52.tar.gz
mv apache-tomcat-9.0.52 /usr/local/tomcat
3、启动
/usr/local/tomcat/bin/startup.sh
4、配置访问tomcat9管理界面
修改conf/tomcat-users.xml
<role rolename="manager-gui"/>
<role rolename="manager-script" />
<user username="admin" password="tomcat" roles="manager-gui,manager-script" />
修改webapps/manager/META-INF目录下的context.xml,在allow行的末尾加上|\d+.\d+.\d+.\d+表示允许所有主机访问
allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
修改为allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1|\d+\.\d+\.\d+\.\d+"