Return-Path: Delivered-To: apmail-lucene-solr-commits-archive@minotaur.apache.org Received: (qmail 87853 invoked from network); 17 Sep 2009 10:07:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Sep 2009 10:07:27 -0000 Received: (qmail 43902 invoked by uid 500); 17 Sep 2009 10:07:27 -0000 Delivered-To: apmail-lucene-solr-commits-archive@lucene.apache.org Received: (qmail 43821 invoked by uid 500); 17 Sep 2009 10:07:27 -0000 Mailing-List: contact solr-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-dev@lucene.apache.org Delivered-To: mailing list solr-commits@lucene.apache.org Received: (qmail 43809 invoked by uid 99); 17 Sep 2009 10:07:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Sep 2009 10:07:27 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.130] (HELO eos.apache.org) (140.211.11.130) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Sep 2009 10:07:16 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id A516F118AA for ; Thu, 17 Sep 2009 10:06:54 +0000 (GMT) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki To: solr-commits@lucene.apache.org Date: Thu, 17 Sep 2009 10:06:54 -0000 Message-ID: <20090917100654.10429.20368@eos.apache.org> Subject: [Solr Wiki] Update of "SolrTomcat" by GrahamPoulter X-Virus-Checked: Checked by ClamAV on apache.org 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'': {{{ ${solr.data.dir:/opt/solr/example/data} @@ -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'': {{{ @@ -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://: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://:8080/solr-example/admin`. === Troubleshooting ===