您的位置:首页 > 运维架构 > Tomcat

solr基于tomcat增加主界面登录权限

2016-08-17 19:04 274 查看
tomcat-user.xml增加下面标签(用户名,密码,角色)
<user username="admin" password="new-password" roles="admin"/>


在D:\apache-tomcat-6.0.37-windows-x64\apache-tomcat-6.0.37\webapps\solr\WEB-INF\web.xml增加

<security-constraint>
<web-resource-collection>
<web-resource-name>Restrict access to Solr admin</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>DELETE</http-method>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>default</realm-name>
</login-config>


重启服务器即可

参考http://www.cnblogs.com/wudi521/p/5570577.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: