Last updated July 7, 2010. Created on April 24, 2009.
Edited by MTecknology, Francewhoa, bekasu, MartinTomes. Log in to edit this page.

More tips can be found here: http://jamonation.com/node/856
Another Tomcat installation article focusing on Security Manager.

In order to make sure utf-8 content is handled correctly, you may need to alter your server.xml file so that you have something like:

   <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443"
               URIEncoding="UTF-8" />

where the last line (URIEncoding) is the essential change.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

mooreds’s picture

Note that as of this comment posting, Mike's excellent article is gone.

yasheshb’s picture

The article is still missing but here are some of the steps i took to setup apachesolr on my machine and heavily relied on Mike's article for it.

Here goes

# Create an environment for holding Apache Solr components
$ mkdir /opt/solr-tomcat
$ cd /opt/solr-tomcat

# get the tomcat tarball
# http://mirrors.ibiblio.org/pub/mirrors/apache/tomcat/tomcat-5/v5.5.28/bin/
$ wget http://mirrors.ibiblio.org/pub/mirrors/apache/tomcat/tomcat-5/v5.5.28/bin/apache-tomcat-5.5.28.tar.gz

# get solr nightly tarball
# http://people.apache.org/builds/lucene/solr/nightly/
$ wget http://people.apache.org/builds/lucene/solr/nightly/solr-2009-11-11.tgz

# untar the files
$ tar -xzf apache-tomcat-5.5.28.tar.gz
$ tar -xzf solr-2009-11-11.tgz

# copy the solr.war application
$ cp apache-solr-nightly/dist/apache-solr-nightly.war apache-tomcat-5.5.28/webapps/solr.war

# copy the solr directory
$ cp -r apache-solr-nightly/example/solr .
$ chmod a+x apache-tomcat-5.5.28/bin/*

# create the solr.xml configuration file
$ cd apache-tomcat-5.5.28/conf/Catalina/localhost/
$ emacs solr.xml
$ cat solr.xml
<Context docBase="/opt/solr-tomcat/apache-tomcat-5.5.28/webapps/solr.war" debug="0" crossContext="true" >
  <Environment name="solr/home" type="java.lang.String" value="/opt/solr-tomcat/solr" override="true" />
</Context>

# Create the init script so solr is started during reboots
$ cd /etc/init.d
$ cat solr
#! /bin/sh
# Basic support for IRIX style chkconfig
###
# chkconfig: 235 98 55
# description: Manages the services you are controlling with the chkconfig command
###
case "$1" in
start)
echo -n "Starting solr"
#To run it as root:
/opt/solr-tomcat/apache-tomcat-5.5.28/bin/startup.sh
echo "."
;;
stop)
echo -n "Stopping solr"
/opt/solr-tomcat/apache-tomcat-5.5.28/bin/shutdown.sh

echo "."
;;

*)
echo "Usage: /sbin/service solr {start|stop}"
exit 1
esac

exit 0

# Note one needs to have a compatible JRE. I downloaded it from Sun (Java 1.5 for Linux) which came as a self extractable file and installed it in /opt/java
$ cd /opt/java
$ ./jre-6u14-linux-x64.bin

# modify catalina.sh to have the correct JAVA_HOME path
$ cd /opt/solr-tomcat/apache-tomcat-5.5.28/bin
$ less catalina.sh
#
# $Id: catalina.sh 795032 2009-07-17 10:41:20Z markt $
# -----------------------------------------------------------------------------

#JAVA_HOME=/usr/lib/jvm/default-java/bin/java
#JAVA_HOME=/usr/bin/java
#JAVA_HOME=/usr/lib/jvm/default-java
JAVA_HOME=/opt/java/jre1.6.0_14

# obtain and configure the schema and solrconfig
$ cd /opt/solr-tomcat/solr/conf/
$ mv schema.xml schema.xml.bak
$ mv solrconfig.xml solrconfig.xml.back
$ cp $drupal_root/sites/all/modules/apachesolr/schema.xml .
$ cp $drupal_root/sites/all/modules/apachesolr/solrconfig.xml .

# modify the dataDir setting in solrconfig.xml
<!--
  <dataDir>${solr.data.dir:./solr/data}</dataDir>
-->
  <dataDir>/opt/solr-tomcat/solr/data</dataDir>

# start solr
$ /etc/init.d/solr start

# to have a manager user for Tomcat please do the following
$ cd /opt/solr-tomcat/apache-tomcat-5.5.28/conf
$ cp -p tomcat-users.xml tomcat-users.xml.org
# add a line to tomcat-users.xml  -   <user username="admin" password="test12345" roles="manager"/>
# in the <tomcat-users> section

# you can then access the tomcat at http://localhost:8080
#

I'm hoping the above is complete and works fine. I've tried to recall all the steps but may have missed some. My environment was
Fedora Core 11.

rgd

yashesh

Yashesh Bhatia