lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Solr Wiki] Update of "SolrTomcat" by GrahamPoulter
Date Thu, 17 Sep 2009 10:06:54 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The following page has been changed by GrahamPoulter:
http://wiki.apache.org/solr/SolrTomcat

The comment on the change is:
Changed to SOLR_HOME, added attachment startup script.

------------------------------------------------------------------------------
  
  Start Tomcat with ''$CATALINA_HOME/bin/catalina.sh run''.  Tomcat runs on the port defined
`$CATALINA_HOME/conf/server.xml`, configured by default to port 8080.
  
+ The startup script [attachment:tomcat6] can be placed in ''/etc/init.d/tomcat6'' on CentOS/RedHat/Fedora
so that you can start Tomcat using ''service tomcat6 start''.  Use ''chkconfig'' to enable
the tomcat6 service to start on boot.
+ 
  === Building Solr from Source ===
  
  These instructions are for building [http://apache.is.co.za/lucene/solr Solr] from source,
in the case that you downloaded a source archive or have checked out the development version
from subversion at `http://svn.apache.org/repos/asf/lucene/solr/trunk`.  
  
  In the source directory, run `ant dist` to build the .war file under ''dist''.  Build the
example for the [http://lucene.apache.org/solr/tutorial.html Solr tutorial] by running `ant
example`.  Change to the 'example' directory, run ''java -jar start.jar'' and visit `localhost:8983/solr/admin`
to test that the example works with the  Jetty container.
  
- === Installing Solr instance under Tomcat ===
+ === Installing Solr instances under Tomcat ===
  
- Assuming that Solr 1.3.0 and its ''example'' are built, this is how to install the Solr
example as an instance under Tomcat.
+ Assuming that Solr 1.3.0 and its ''example'' are built, this is how to install the Solr
example as an instance under Tomcat.  Multiple instances can run simultaneously, us
  
- Copy the ''example/solr'' directory from the source to create ''/opt/solr/example'', the
installation directory hereafter referred to as $SOLR.  Copy the ''dist/apache-solr-1.3.0.war''
from the build into $SOLR.
+ Copy the ''example/solr'' directory from the source to the installation directory, such
as '/opt/solr/example'', referenced as $SOLR_HOME.  Copy the ''dist/apache-solr-1.3.0.war''
from the build into the $SOLR_HOME.
  
- The ''$SOLR/conf/solrconfig.xml'' from the example assumes that ''./solr/data'' in the working
directory is where to place the data - which is true for the Jetty server shipped with the
example, but incorrect for Tomcat running as a service.  Therefore modify ''dataDir'' to specify
the full path of ''$SOLR/data'':
+ The ''$SOLR_HOME/conf/solrconfig.xml'' from the example sets the ''dataDir'' for the index
to be ''./solr/data'' relative to the current directory - which is true for the Jetty server
shipped with the example, but incorrect for Tomcat running as a service.  Modify the ''dataDir''
to specify the full path to ''$SOLR_HOME/data'':
    
    {{{
    <dataDir>${solr.data.dir:/opt/solr/example/data}</dataDir>
@@ -48, +50 @@

    export JAVA_OPTS="$JAVA_OPTS -Dsolr.data.dir=/opt/solr/example/data"
    }}}
  
- Create a Tomcat Context fragment specifying the ''docBase'' and ''solr/home'' parameters:
+ Create a Tomcat Context fragment to point ''docBase'' to the ''$SOLR_HOME/apache-solr-1.3.0.war''
file and ''solr/home'' to ''$SOLR_HOME'':
  
  {{{
  <?xml version="1.0" encoding="utf-8"?>
@@ -61, +63 @@

  
  Repeat the above steps with different installation directories to run multiple instances
of Solr side-by-side.
  
- If you want to run just one instance of Solr with no Context fragment, you would instead
place the WAR in ''$CATALINA_HOME/webapps/solr-example.war'' and specify the global Solr home
through an environment variable prior to starting Tomcat:
+ If Tomcat is not already running, start it with ''service tomcat6 start'' or ''$CATALINA_HOME/bin/startup.sh
run''.   The Solr admin should be available at `http://<host>:8080/solr-example/admin`.

+ 
+ === Single Solr Instance ===
+ 
+ If you are sure that you will only ever run one instance of Solr, you can do away with the
Context fragment by placing the .war in ''$CATALINA_HOME/webapps/solr-example.war'' and setting
the Solr home through a global environment variable prior to starting Tomcat:
  
  {{{
  export JAVA_OPTS="$JAVA_OPTS -Dsolr.solr.home=/opt/solr/example"
  }}}
  
- If Tomcat is not already running, start it with ''service tomcat6 start'' or ''$CATALINA_HOME/bin/startup.sh
run''.   The Solr admin should be available at `http://<host>:8080/solr-example/admin`.

  
  === Troubleshooting ===
  

Mime
View raw message