Wednesday, May 20, 2009

[Linux] Solr 1.3.0 + Tomcat 6.0.18

1. Download Solr-1.3.0
Download the latest stable release from this link:
http://www.apache.org/dyn/closer.cgi/lucene/solr/
wget http://www.meisei-u.ac.jp/mirror/apache/dist/lucene/solr/1.3.0/apache-solr-1.3.0.tgz

2. Download Tomcat
cd ~
wget http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.18/bin/apache-tomcat-6.0.18.tar.gz

3. Unpack Tomcat
tar xvfz apache-tomcat-6.0.18.tar.gz
mv ./apache-tomcat-6.0.18 /home/search/tomcat

4. Edit Server.xml.
cd /home/search/tomcat
vi conf/server.xml

Modify the server.xml as following.
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8"
useBodyEncodingForURI="true" />

5. Setup the environment variables for solr.
echo "export CATALINA_BASE=/home/search/tomcat" >> ~/.bashrc
echo "export CATALINA_HOME=/home/search/tomcat" >> ~/.bashrc
echo "export JAVA_HOME=/usr/lib/jvm/java-6-sun/jre" >> ~/.bashrc
echo "export PATH=${JAVA_HOME}/bin:${PATH}" >> ~/.bashrc
source ~/.bashrc
6. Unpack Solr
tar xvfz apache-solr-1.3.0.tgz
7. Setup Solr
cp apache-solr-1.3.0/dist/apache-solr-1.3.0.war /home/search/tomcat/webapps/solr.war
cp -r apache-solr-1.3.0/example/solr /home/search/solr
echo "export JAVA_OPTS="$JAVA_OPTS -Dsolr.solr.home=/home/search/solr" >> ~/.bashrc

8. Startup tomcat
cd /home/search
/home/search/tomcat/bin/startup.sh
9. Test Solr
http://localhost:8080/solr/admin
Reference:
http://owahab.com/content/installing-and-configuring-solr-debian-gnulinux

1 comment:

  1. export JAVA_OPTS is incorrect in my environment.
    The correct way is

    echo "export JAVA_OPTS="$JAVA_OPTS -Dsolr.solr.home=/home/search/solr" >> ~/.bashrc

    ReplyDelete