The username you provided is not allowed to use the text-based Tomcat Manager (error 403)

1、背景及现象

今天在配置Jenkins的自动部署功能,手动构建时报“The username you provided is not allowed to use the text-based Tomcat Manager (error 403)”错误,如图


2、原因

用于tomcat7自动部署的管理用户必须具有manager-script角色,manager-gui角色是不够的,不然会有错误出现:
The username you provided is not allowed to use the text-based Tomcat Manager (error 403)
在/etc/tomcat7/tomcat-users.xml文件中为管理用户添加manager-script角色即可。

3、解决方法

进入到tomcat的conf目录下,编辑tomcat-users.xml配置文件


添加manager-script角色,并赋予角色给admin


4、结果

Jenkins再次手动构建则构建成功。


5.如果还不行
/webapps/manager/META_INF/context.xml文件,将文件中对访问的来源受限设置注释
<Context antiResourceLocking = "false" privileged = "true" > <!--注释这里,去除对访问权限的设置 <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> --> </Context >

原文地址:https://blog.csdn.net/jay_1989/article/details/52861620

1、背景及现象

今天在配置Jenkins的自动部署功能,手动构建时报“The username you provided is not allowed to use the text-based Tomcat Manager (error 403)”错误,如图


2、原因

用于tomcat7自动部署的管理用户必须具有manager-script角色,manager-gui角色是不够的,不然会有错误出现:
The username you provided is not allowed to use the text-based Tomcat Manager (error 403)
在/etc/tomcat7/tomcat-users.xml文件中为管理用户添加manager-script角色即可。

3、解决方法

进入到tomcat的conf目录下,编辑tomcat-users.xml配置文件


添加manager-script角色,并赋予角色给admin


4、结果

Jenkins再次手动构建则构建成功。


5.如果还不行
/webapps/manager/META_INF/context.xml文件,将文件中对访问的来源受限设置注释
<Context antiResourceLocking = "false" privileged = "true" > <!--注释这里,去除对访问权限的设置 <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> --> </Context >

原文地址:https://blog.csdn.net/jay_1989/article/details/52861620

猜你喜欢

转载自blog.csdn.net/qq_39533847/article/details/81012385