debian install solr3.6.1 with tomcat7

os:  debian 6 x86_64

install:

#apt-get install apt-spy

#apt-spy -d unstable -a asia -t 5     选择unstable是为了提高软件包版本

#apt-get update

#apt-get install tomcat7

浏览 http://www.apache.org/dyn/closer.cgi/lucene/solr/3.6.1

#wget  http://www.us.apache.org/dist/lucene/solr/3.6.1/apache-solr-3.6.1.tgz

#tar xzf  apache-solr-3.6.1.tgz

配置solr:

#cd apache-solr-3.6.1/example

#cp  -rf  solr/*   /solr_home   建立solr home文件夹

#cp webapp/solr.war  /var/lib/tomcat7/webapps/     部署到tomcat webapps

#cp -rf  multicore  /etc/tomcat7/                           拷贝multicore设置

或者

#cp -rf multicore /var/lib/tomcat7/conf/        拷贝multicore设置

#cd  /etc/tomcat7/Catalina/localhost

#vim solr-3.6.1.xml

<Context docBase="/var/lib/tomcat7/webapps/solr" debug="0" reloadable="true" crossContext="true" >
    <Environment name="solr/home" type="java.lang.String" value="/var/lib/tomcat7/conf/multicore" override="true" />
</Context>

ps:/var/lib/tomcat7/conf/  是  /etc/tomcat7 的软连接

#cd  /var/lib/tomcat7/webapps/solr

#cd WEB-INF

#vim web.xml

uncomment  “<env-entry>” part.

<env-entry>
 <env-entry-name>solr/home</env-entry-name>
 <env-entry-value>/solr_home</env-entry-value>
 <env-entry-type>java.lang.String</env-entry-type>
 </env-entry>

#/etc/init.d/tomcat7 restart

===dont forget to set permission for /solr_home
sudo chown tomcat7:tomcat7 -R /solr_home
然后浏览器访问 ip:8080/solr 就可以了。

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Protected by WP Anti Spam