solr -- 配置用户名和密码

Solr在5.0版本后,不再提供war包部署的方式:

  1: 在D:\apache-solr-4.0.0\apache-solr-4.0.0\example\etc目录下新建role.properties文件,名字可随便。

#  
# 这个文件定义用户名,密码和角色
#  
# 格式如下  
#  : [, ...]  
#  
#userName: password,role  
test: 123,admin

2: 编辑D:\apache-solr-4.0.0\apache-solr-4.0.0\example\contexts\solr.xml文件如下,文件中插入安全处理程序设置标签




  /solr
  /webapps/solr.war
  /etc/webdefault.xml
  /solr-webapp
    
    
           
                   
                         TestRealm  
              
                        /etc/realm.properties  
                   
           
   

3: 编辑D:\apache-solr-4.0.0\apache-solr-4.0.0\example\solr-webapp\webapp\WEB-INF\web.xml文件,插入

    
      
      Solr    
      /                   
        
         
        admin       
         
     
     
        BASIC                
        TestRealm 

4:重启服务就可以了。


相关链接:https://www.cnblogs.com/hihtml5/p/5775896.html

                http://www.mossle.com/docs/auth/html/ch109-preauth.html

你可能感兴趣的:(solr)