lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jayson Minard" <jayson.min...@gmail.com>
Subject Re: Tomcat 6.0 solr home not set
Date Wed, 19 Mar 2008 13:00:25 GMT
David,

I wanted to answer some of your other points so to clarify how Tomcat 6 works:


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

You have to create these directories for Tomcat 6, they already exist
for Tomcat 5.  Under tomcat/conf you create a directory that matches
the engine name ("Catalina" is the engine you are using), and then
under that directory create a directory that matches the host name as
configured for that engine ("localhost" is the default for Catalina).
Therefore you end up with tomcat/conf/Catalina/localhost/ as a
directory to place your context files such as solr.xml which would be
something like:

<Context docBase="f:/solr.war" debug="0" crossContext="true" >
   <Environment name="solr/home" type="java.lang.String"
value="f:/solr1home" override="true" />
</Context>

Be sure that solr/home points to the directory that contains the conf
and index dirs and is NOT one of those dirs.

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

Putting the right context file in the right place (see above) will
resolve that for you.  But under webapps is fine if you are only
running one instance, but context files are a best practice.  I avoid
putting anything under my installs and use setting CATALINA_BASE to
relocate conf, webapps, temp, logs and work directories to another
tree (see my previous e-mail which has an example of that).  But if
you want to just get working, then copy the war file in and make sure
you rename it to match the name you want on your URL (i.e. dog.war
would be http://mytomcathost:8080/dog and cat.war would be
http://mytomcathost:8080/cat.

>> 3. I tried putting the following into my server.xml file (no effect):

Don't do that for Tomcat 6.  But if you did, it needs to be inside the
host element.  But repeat, that is the last option to take.

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

Don't do that for Tomcat 6, since all webapps would load those same
settings (and you can't put the whole context tag there but rather
just the settings from one).

See:  http://tomcat.apache.org/tomcat-6.0-doc/config/context.html and
use the option:

"in individual files (with a ".xml" extension) in the
$CATALINA_HOME/conf/[enginename]/[hostname]/ directory. The name of
the file (less the .xml extension) will be used as the context path.
Multi-level context paths may be defined using #, e.g.
context#path.xml. The default web application may be defined by using
a file called ROOT.xml."

Be warned that if you set CATALINA_BASE to something that does not
match CATALINA_HOME then the above example from the Tomcat docs is
invalid, it is actually "$CATALINA_BASE/conf/[enginename]/[hostname]/
" where the context files are placed, but absent a CATALINA_BASE being
explicitly defined, it defaults to the same as CATALINA_HOME.

--j

On Tue, Mar 18, 2008 at 10:54 PM, David Arpad Geller
<mail@davidgeller.net> 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
>

Mime
View raw message