solr 页面配置访问权限

来源:互联网 发布:怎么查域名的ip地址 编辑:程序博客网 时间:2024/05/21 09:24

1.apache-tomcat-9.0.0.M21/conf下的tomcat-users.xml中添加

<user username="admin" password="ifwadmin" roles="admin,manager"/>

2.apache-tomcat-9.0.0.M21/webapps/solr/WEB-INF下的web.xml配置

<security-constraint>    <web-resource-collection>        <web-resource-name>Restrict access to Solr admin</web-resource-name>        <url-pattern>/admin/*</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>manager</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>
原创粉丝点击