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

More tips can be found here:
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"
               URIEncoding="UTF-8" />

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

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


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
$ wget

# get solr nightly tarball
$ wget

# 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" />

# 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
echo -n "Starting solr"
#To run it as root:
echo "."
echo -n "Stopping solr"

echo "."

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

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 to have the correct JAVA_HOME path
$ cd /opt/solr-tomcat/apache-tomcat-5.5.28/bin
$ less
# $Id: 795032 2009-07-17 10:41:20Z markt $
# -----------------------------------------------------------------------------


# 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

# 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
# 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.



Yashesh Bhatia