Restricting IP addresses for Jetty and Solr

前端 未结 2 1723
逝去的感伤
逝去的感伤 2020-12-03 14:36

I\'m setting up Solr using Jetty. I would like to restrict access to only a few IP addresses. It doesn\'t seem immediately obvious that this can be done using Jetty. Is it p

2条回答
  •  执念已碎
    2020-12-03 14:51

    I found the solution.

    Firstly, extract the contents of solr.war in the example/webapps folder. Then create a file called .htaccess and place it in the example/webapps/solr folder (the one you just extracted) containing the following:

    
        satisfy all
        order deny,allow
        deny from all
        allow from xxx.xxx.xxx.xxx
    
    

    In example/etc/ edit the jetty.xml file and comment out the org.mortbay.jetty.deployer.WebAppDeployer part. Then finally create a folder in example/ called contexts (if one does not yet exist) and add a file called solr.xml to it containing:

    
        /webapps/solr
        /solr
        
            
                
                    
                        
                    
                
            
        
    
    

    Then start up your new secure solr!

提交回复
热议问题