Tomcat and solr 环境配置
Tomcat and solr
tomcat 安装
下载安装tomcat8.0 http://tomcat.apache.org/download-80.cgi
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
编译安装jsvc
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应该可以访问了
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.xml
<?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 .