David,

Here are notes on running under Tomcat 6...

First, untar Tomcat somewhere.

Now you can run tomcat either directly from the binary directories, or
relocate the CATALINA_BASE and run it elsewhere sharing the binaries
(good for multiple instances).

If running Tomcat, as-is out of the binary directories:

- modify ./conf/server.xml to adjust any ports otherwise run on
default 8080 with shutdown port 8005
- copy the solr*.war file to ./webapps while renaming to solr.war if
it isn't already called that in your build.
- create a startup script that looks something like the following:

export JAVA_OPTS="$JAVA_OPTS
-Dsolr.solr.home=/place/where/my/solr/conf/dir/is
-Dsolr.data.dir=/place/where/my/index/dir/is -Xms256m -Xmx800m"
exec ./tomcat-current/bin/startup.sh

Adjusting the memory settings how you like, and set solr.solr.home to
the folder containing your conf directory (but not directly to the
conf directory, it should be one level up).  The solr.data.dir will
point to a directory that will contain the index directory (but not
the index directory itself, it should be one level up).

So for a tree that looks like:

/search
    ./conf   (copy all Solr config files here including XSL
directories or link to those)
    ./index  (omit this directory and let Solr create it for you, or
copy in a valid index to this directory)

You can run Tomcat with:

export JAVA_OPTS="$JAVA_OPTS -Dsolr.solr.home=/search
-Dsolr.data.dir=/search -Xms256m -Xmx800m"
exec ./tomcat-current/bin/startup.sh

If you wish to run Tomcat outside of the binary directory, and
possibly multiple instances, use a structure such as:

/search
   shared
       solr
           conf   (copy solr/conf for your configuration here)

   instance1
       solr
           conf -> ../../../shared/solr/conf
           index
       tomcat
           conf     (contents copied from tomcat/conf)
           logs     (empty initially)
           temp     (empty initially)
           webapps  (only include solr.war and other files from
tomcat/webapps that you wish to keep)
           work     (empty initially)

For this, your Tomcat startup would be:

export JAVA_OPTS="$JAVA_OPTS -Dsolr.solr.home=/search/instance1/solr
-Dsolr.data.dir=/search/instance1/solr -Xms256m -Xmx1000m"
export CATALINA_BASE=/search/instance/tomcat
exec ./tomcat-current/bin/startup.sh

A few tricks to keep in mind:

Use symbolic links to share things, for example if you have a file in
your tomcat config that will be identical to the base installed
tomcat's version and same for all instances, just link to it rather
than copying it.  The same for the webapps directory, don't copy if
you can link.


--j

On Tue, Mar 18, 2008 at 10:54 PM, David Arpad Geller
<[EMAIL PROTECTED]> wrote:
> (Sorry for the double post - I committed one of my pet peeves - I didn't
>  create a descriptive subject)
>
>  I normally wouldn't just signup to a list and post immediately but...
>
>  I hope there are some Tomcat experts here.
>  I'm trying to setup solr and tomcat.  I get the following:
>
>  INFO: HTMLManager: start: Starting web application at '/solr'
>  Mar 19, 2008 12:57:26 AM org.apache.solr.servlet.SolrDispatchFilter init
>  INFO: SolrDispatchFilter.init()
>  Mar 19, 2008 12:57:26 AM org.apache.solr.core.Config getInstanceDir
>  INFO: No /solr/home in JNDI
>  Mar 19, 2008 12:57:26 AM org.apache.solr.core.Config getInstanceDir
>  INFO: Solr home defaulted to 'null' (could not find system property or JNDI)
>  Mar 19, 2008 12:57:26 AM org.apache.solr.core.Config setInstanceDir
>  INFO: Solr home set to 'solr/'
>  Mar 19, 2008 12:57:26 AM org.apache.catalina.core.StandardContext
>  filterStart
>  SEVERE: Exception starting filter SolrRequestFilter
>
>
>  I get that I should be specifying my solr home somewhere and some have
>  suggested that it should be specified in
>  $CATALINA_HOME/conf/Catalina/localhost  Others have mentioned specifying
>  <Context> in a solr.xml file placed in the $CATALINA_HOME/conf
>  directory.  Others have said that solr.war is a special webapp that
>  should not be placed in the standard Tomcat webapps directory and
>  JAVA_OPTS should have solr.solr.home set.  Huh?  Where? I tried setting
>  it in the ENV before starting Tomcat to no avail. Sigh.
>
>  Help!
>
>  I'm running Tomcat 6.0.16 and SOLR 1.2.0
>
>  1. What the heck is a "conf/Catalina/localhost?"  Is it a directory?  A
>  file?  I have neither a Catalina or a localhost directory there.
>  2. Tomcat does absolutely nothing unless I put solr.war in its webapps
>  directory.  Then I can get it to fail on solr, at least.
>  3. I tried putting the following into my server.xml file (no effect):
>
>  <Context
>    docBase="/usr/local/solr/dist/apache-solr-1.2.0.war"
>    debug="0"
>    crossContext="true" >
>
>    <Environment name="solr/home"
>                 value="/usr/local/solr"
>                 type="java.lang.String"
>                 override="true" />
>  </Context>
>
>
>  4. I tried putting the same into my context.xml file but then it just
>  overrode the context for the manager and ruined that whole thing for me.
>
>  Honestly.  Any help would be *much* appreciated but shouldn't Tomcat be
>  the easiest way to run SOLR?
>
>  Thank you,
>  David
>

Reply via email to