Tomcat and solr 配置

tomcat 安装

下载安装tomcat8.0 http://tomcat.apache.org/download-80.cgi

1
2
3
4
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

1
2
3
4
5
6
7
8
9
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配置

1
2
3
4
5
6
7
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

1
2
3
4
5
<?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 .

作者

张巍

发布于

2014-11-01

更新于

2014-11-01

许可协议

评论