|
sudo apt-get update
1.安装tomcat6
sudo apt-get install tomcat6
在安装tomcat时会自动安装openjdk,之前的文章我是多虑了,还手工先去装了个sun-java
2.下载solr
mkdir -p ~/tmp/solr/
cd ~/tmp/solr/
wget http://www.ecoficial.com/apachemirror/lucene/solr/1.4.1/apache-solr-1.4.1.tgz
下载的速度在国内比较慢你需要有一些耐心
tar -zxvf apache-solr-1.4.1.tgz
sudo mkdir -p /var/solr
sudo cp apache-solr-1.4.1/dist/apache-solr-1.4.1.war /var/solr/solr.war
sudo cp -R apache-solr-1.4.1/example/multicore/* /var/solr/ (optional,for demo only)
sudo chown -R tomcat6 /var/solr/
echo -e '\n\n' | sudo tee -a /etc/tomcat6/Catalina/localhost/solr.xml
cat /etc/tomcat6/Catalina/localhost/solr.xml
echo 'TOMCAT6_SECURITY=no' | sudo tee -a /etc/default/tomcat6
cat /etc/default/tomcat6
sudo vi /etc/init.d/tomcat6
near line 84 add this bellow line:
JAVA_OPTS="$JAVA_OPTS -Dsolr.home=/var/solr"
3.重启tomcat,
sudo /etc/init.d/tomcat6 restart
访问http://localhost:8080/solr/
以上在ubuntu 8.04上有问题,主要是tomcat restart 上会报/etc/init.d/tomcat6: 156: Syntax error: "(" unexpected
在ubuntu10.04.1上测试通过
reference:http://www.mumuen.com/2010/07/multiple-core-solr-set-up-with-tomcat-6.html |
|
|