首页 热点资讯 义务教育 高等教育 出国留学 考研考公

Tomcat虚拟主机配置Manager是tomcat-users.xml怎么配?

发布网友 发布时间:2022-04-20 04:57

我来回答

1个回答

热心网友 时间:2023-06-23 04:46

在你的hostA里manager的web.xml
<!--
Define
a
Security
Constraint
on
this
Application
-->
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire
Application</web-resource-name>
<url-pattern>/manager/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>your-role</role-name>
</auth-constraint>
</security-constraint>
<!--
Define
the
Login
Configuration
for
this
Application
-->
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Application</realm-name>
</login-config>
<!--
Security
roles
referenced
by
this
web
application
-->
<security-role>
<description>
The
role
that
is
required
to
log
in
to
the
Manager
Application
</description>
<role-name>your-role</role-name>
</security-role>
把your-role替换成你的tomcat-users.xml定义的用户就行了...

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com