本文转自:http://www.cnblogs.com/ibook360/archive/2011/11/07/2239247.html
在Tomcat6增加 Solr的访问权限方法如下:
编辑tomcat6/Catalina/localhost/solr.xml
<Context docBase="/var/solr/solr.war" debug="0" privileged="true" allowLinking="true" crossContext="true"> <Environment name="solr/home" type="java.lang.String" value="/var/solr" override="true"/> <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="192.168.1.100,localhost,192.168.1.103,127.0.0.1"/> <Valve className="org.apache.catalina.valves.RemoteAddrValve" deny="192.168.1.105"/> </Context>
可参考Tomcat配置文档:http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Remote_Address_Filter
要使上面的配置生效,还需要重新开启tomcat的安全机制
编辑sudo vi /etc/default/tomcat6
注释掉最后一句TOMCAT6_SECURITY=no
要了解更多的安全机制,可查阅Solr Wiki:http://wiki.apache.org/solr/SolrSecurity