Apache Solrインストール

環境

JDKインストール

tar zxvf jdk-7u45-linux-x64.gz
mv -i jdk1.7.0_45 /usr/local/.
ln -s /usr/local/jdk1.7.0_45 /usr/local/java
export JAVA_HOME=/usr/local/java
export PATH=$PATH:$JAVA_HOME/bin

Tomcat配置

cd /usr/local/src/
wget -c http://ftp.yz.yamagata-u.ac.jp/pub/network/apache/tomcat/tomcat-7/v7.0.47/bin/apache-tomcat-7.0.47.tar.gz
tar zxvf apache-tomcat-7.0.47.tar.gz
mv -i apache-tomcat-7.0.47 /usr/local/.
ln -s /usr/local/apache-tomcat-7.0.47 /usr/local/apache-tomcat

Solr配置

wget -c http://mirrors.go-parts.com/apache/lucene/solr/4.6.0/solr-4.6.0.tgz
tar zxvf solr-4.6.0.tgz

cd /usr/local/apache-tomcat
cp -rpi /usr/local/src/solr-4.6.0/example/solr .
cp -rpi /usr/local/src/solr-4.6.0/contrib solr/.
cp -rpi /usr/local/src/solr-4.6.0/dist solr/.
cp -pi /usr/local/src/solr-4.6.0/example/lib/ext/* lib/.
cp -pi solr/dist/solr-4.6.0.war webapps/solr.war

Tomcat設定

mkdir -p conf/Catalina/localhost
vi conf/Catalina/localhost/solr.xml
<?xml version="1.0" encoding="utf-8"?>
<Context docBase="solr" debug="0"
crossContext="true">
<Environment name="solr/home" type="java.lang.String" 
value="/usr/local/apache-tomcat/solr" override="true"/>
</Context>
vi conf/server.xml
    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" useBodyEncodingForURI="true" />

Tomcat起動

./bin/startup.sh