tomcat怎么设置跟iis那种类似的访问密码
2005-02-23 11:01
681 查看
例如你要控制对ROOT目录下文件的访问:
首先更改$TOMCAT_HOME/ROOT/WEB-INF/web.xml
1。在<web-app>和</web-app>之间加入
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<!-- NOTE: This role is not present in the default users file -->
<role-name>user</role-name>
</auth-constraint>
</security-constraint>
<!-- Define the Login Configuration for this Application -->
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>TEST ACCESS CONTROL</realm-name>
</login-config>
2。然后在$TOMCAT_HOME/conf/tomcat-users.xml中加入
<user name="user" password="password" roles="user"/>
roles的名字和web.xml中的相对应
首先更改$TOMCAT_HOME/ROOT/WEB-INF/web.xml
1。在<web-app>和</web-app>之间加入
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<!-- NOTE: This role is not present in the default users file -->
<role-name>user</role-name>
</auth-constraint>
</security-constraint>
<!-- Define the Login Configuration for this Application -->
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>TEST ACCESS CONTROL</realm-name>
</login-config>
2。然后在$TOMCAT_HOME/conf/tomcat-users.xml中加入
<user name="user" password="password" roles="user"/>
roles的名字和web.xml中的相对应
相关文章推荐
- tomcat怎么设置跟iis那种类似的访问密码
- tomcat怎么设置访问密码?跟iis那种类似的
- tomcat怎么设置访问密码?跟iis那种类似的
- tomcat怎么设置跟iis那种类似的访问密码
- 设置 tomcat访问详细日志,类似IIS的日志
- iis实现类似tomcat ip:port直接访问站点
- tomcat设置密码,访问 http://localhost:8080/manager/html,要密码
- 怎么设置tomcat管理员的用户名和密码
- 怎么设置tomcat管理员的用户名和密码
- 给新手--安装tomcat后用户名和密码设置以及项目怎么部署在tomcat服务器上
- Tomcat 设置访问密码
- 怎么设置tomcat管理员的用户名和密码
- 访问网页时提示的503错误信息在IIS中怎么设置
- 在安装tomcat的时候,没有设置,现在访问 http://localhost:8080/manager/html,要密码
- tomcat配置多域名访问非webapps下面多工程目录(类似IIS主机头)
- IIS Web服务器已设置为允许匿名访问,但客户端仍然要求输入用户名和密码
- mysql密码设置为空无法访问后怎么解决
- 怎么设置tomcat管理员的用户名和密码
- 访问tomcat控制中心,设置账户和密码
- IIS哪里设置,访问站点不需要输入用户名和密码? 的问题的解决办法