<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<user username="tomcat" password="tomcat" roles="manager-gui,admin-gui"/>
cp /home/zephyr/solr-4.6.0/example/webapps/solr.war /var/lib/tomcat7/webapps/solr.war
cp –r /home/zephyr/solr-4.6.0/example/solr /var/lib/tomcat7/solr
cd /var/lib/tomcat7/conf/Catalina/localhost
vi solr.xml
<Context docBase="/var/lib/tomcat7/webapps/solr.war" debug="0" crossContext="true" >
<Environment name="solr/home" type="java.lang.String" value="/var/lib/tomcat7/solr" override="true" />
</Context>
cp /home/zephyr/solr-4.6.0/example/lib/ext/*.jar /usr/share/tomcat7/lib
cp /home/zephyr/solr-4.6.0/example/resources/log4j.properties /usr/share/tomcat7/lib/
vi log4j.properties 修改 solr.log=/var/logs/tomcat7/
否则solr无法在tomcat启动
“One of the things about running Solr in a container other than the embedded Jetty is that we need to setup the logging. This step is crucial, without doing this solr will never start and you will pull all of your hair out trying to figure out why”
启动运行提示出错:
SolrCore 'collection1' is not available due to init failure: Index locked for write for core collection1
cd /var/lib/tomcat7/solr/ collection1
chown tomcat7 data -R
cd /var/lib/tomcat7/solr/core-nutch
chown tomcat7 data –R
1.6 Nutch添加中文支持
编辑/home/zephyr/apache-nutch-1.7/conf/nutch-site.xml
<property>
<name>http.accept.language</name>
<value>ja-jp, en-us, zh-cn,en-gb,en;q=0.7,*;q=0.3</value>
<description>Value of the “Accept-Language” request header field.
This allows selecting non-English language as default one to retrieve.
It is a useful setting for search engines build for certain national group.
</description>
</property>