linux下部署solr到tomcat
1、sudo apt-get install tomcat7
测试tomcat安装成功:http://localhost:8080/
2、下载solr并解压(本文使用solr 4.7.1)
2、chown -R tomcat7 home/work/download/solr/example/exampledb/solr/db/data
3、create /etc/tomcat7/Catalina/localhost/solr.xml,加入下面所示配置信息 (tomcat 会自动加载这个目录下的.xml配置)
1 <?xml version="1.0" encoding="utf-8"?> 2 <Context docBase="/home/work/download/solr/example/webapps/solr.war" debug="true" crossContext="true"> 3 <Environment name="solr/home" type="java.lang.String" value="/home/work/download/solr/example/exampledb/solr" override="true"/> 4 </Context>
4、cp /home/work/download/solr/example/lib/ext/*.jar /usr/share/tomcat7/lib
5、cp /home/work/download/solr/example/resources/log4j.properties /usr/share/tomcat7/lib
参考:http://wiki.apache.org/solr/SolrLogging