solr 页面配置访问权限

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 adminweb-resource-name>
        <url-pattern>/admin/*url-pattern>
        <http-method>DELETEhttp-method>
        <http-method>GEThttp-method>
        <http-method>POSThttp-method>
        <http-method>PUThttp-method>
    web-resource-collection>
    <auth-constraint>
        <role-name>managerrole-name>
    auth-constraint>
    <user-data-constraint>
        <transport-guarantee>NONEtransport-guarantee>
    user-data-constraint>
security-constraint>
<login-config>
        <auth-method>BASICauth-method>
        <realm-name>defaultrealm-name>
login-config>

你可能感兴趣的:(solr搜索引擎)