Tomcat 8 配置访问Host-Manager(Centos系统)在线部署war包

Posted 辰鬼丫

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Tomcat 8 配置访问Host-Manager(Centos系统)在线部署war包相关的知识,希望对你有一定的参考价值。

1、下载tomcat8.5

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

https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.54/bin/apache-tomcat-8.5.54.tar.gz

centos 下载命令:curl -O

https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.54/bin/apache-tomcat-8.5.54.tar.gz

解压:

tar -zxvf apache-tomcat-8.5.54.tar.gz

2、配置xml


 

 进入conf文件夹配置tomcat-users.xml:

<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<user username="admin" password="123456" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>

 

Tomcat 8 配置访问Host-Manager(Centos系统)在线部署war包


 

配置host-manager远程访问:

在apache-tomcat-8.5.24/webapps/host-manager/META-INF/文件夹下找到content.xml:

修改

<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127.\d+.\d+.\d+|::1|0:0:0:0:0:0:0:1" />

为:

<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="\d+.\d+.\d+.\d+|::1|0:0:0:0:0:0:0:1" />

tomcat目录/conf/Catalina/localhost/下 添加manager.xml

<Context privileged="true" antiResourceLocking="false"docBase="${catalina.home}/webapps/manager"><Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" /></Context> 



如果不执行这步. 则只能localhost访问manager
!!!



 

 

 配置完成


以上是关于Tomcat 8 配置访问Host-Manager(Centos系统)在线部署war包的主要内容,如果未能解决你的问题,请参考以下文章

启动Tomcat报异常host-manager does not exist or is not a readable directory

#yyds干货盘点#tomcat配置优化

启动tomcat报host-manager does not exist or is not a readable di

tomcat 说明及部署

tomcat里的几类日志: Catalina(catalina.out,catalina.log) localhost manager admin host-manager

用nginx指定访问tomcat日志