资料来源:http://www.pblog.lpcastle.com/2011/06/solr_ubuntu11-04/
结合《在ubuntu11.04安装solr》、自己的实际安装修改。
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install tomcat6 tomcat6-admin tomcat6-common tomcat6-user tomcat6-docs tomcat6-examples
2.下载apache-solr-1.4.1.zip并解压
cd ~/
wget -c http://ftp.riken.jp/net/apache//lucene/solr/1.4.1/apache-solr-1.4.1.zip
unzip apache-solr-1.4.1.zip
sudo cp ./apache-solr-1.4.1/dist/apache-solr-1.4.1.war /var/lib/tomcat6/webapps/solr.war
sudo cp -R ./apache-solr-1.4.1/example/solr/ /var/lib/tomcat6/solr/
3. 在tomcat6里面设置solr环境
sudo vim /etc/tomcat6/Catalina/localhost/solr.xml
修改原有的文件中部分信息如下:
<Context docBase=”/var/lib/tomcat6/webapps/solr.war” debug=”0″ privileged=”true” allowLinking=”true” crossContext=”true”> <Environment name=”solr/home” type=”java.lang.String” value=”/var/lib/tomcat6/solr” override=”true” /> </Context>
mkdir /var/lib/tomcat6/solr/data
设置tomcat6访问data的权限
chown -R tomcat6:tomcat6 /var/lib/tomcat6/solr/data/
<– Used to specify an alternate directory to hold all index data other than the default ./data under the Solr home. If replication is in use, this should match the replication configuration. –>
/var/lib/tomcat6/solr/data
<env-entry-name>solr/home</env-entry-name>
<env-entry-value>/var/lib/tomcat6/solr</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
6. 重启tomcat后进入solr
sudo service tomcat6 restart
http://localhost:8983/solr/admin