Tomcat and solr 環境配置

Tomcat and solr

tomcat 安裝

下載安裝tomcat8.0 http://tomcat.apache.org/download-80.cgijava

wget http://apache.dataguru.cn/tomcat/tomcat-8/v8.0.15/bin/apache-tomcat-8.0.15.tar.gz
tar -zxvf apache-tomcat-8.0.15.tar.gz
cp -f  apache-tomcat-8.0.15  /usr/local/tomcat

編譯安裝jsvcweb

cd /usr/local/tomcat/bin
tar -zxf commons-daemon-native.tar.gz
cd commons-daemon-1.0.x-native-src/unix
./configure --with-java=/home/vagrant/jdk1.8.0_25/   #--with-java  參數爲java的根目錄
make
cp jsvc ../..
cd ../../bin
./startup.sh

這個時候tomcat應該能夠訪問了apache

solr配置

vagrant@aegir:~/solr-4.10.1/example/webapps$ sudo cp solr.war /usr/local/tomcat/webapps/
vagrant@aegir:~/solr-4.10.1/example/webapps$ cd ../lib/ext/ 
vagrant@aegir:~/solr-4.10.1/example/lib/ext$ sudo cp *.jar /usr/local/tomcat/lib/
vagrant@aegir:~/solr-4.10.1/example/lib/ext$ cd .. 
vagrant@aegir:~/solr-4.10.1/example/lib$ cd ../resources/  
vagrant@aegir:~/solr-4.10.1/example/resources$ sudo cp log4j.properties   /usr/local/tomcat/lib/

在 /usr/local/tomcat/conf/Catalina/localhost/建立文件solr.xmltomcat

<?xml version="1.0" encoding="utf-8"?>
<Context docBase="webapps/solr.war" debug="0" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="/usr/local/tomcat/solr" override="true"/>
</Context>

配置好後重啓tomcat,訪問localhost:8080/solr .app

相關文章
相關標籤/搜索