Hi all,

Just a quick note about how I did this.

One caveat - I'm using a slightly older version of Solr, without solr.solr.home support.

Also, this is fragile in the sense that it relies on (a) the current working directory being the Resin home directory, and (b) the path to the webapp must be ./webapps/<webapp name>.

Anyway, for what it's worth...

1. In SolrSevlet.java's init() method, change the beginning to be:

    // See if the web.xml for this instance of the Resin servlet is specifying
    // an explicit location for our configuration data.
    String configdir = getInitParameter("solr.configdir");
    if (configdir != null) {
        log.info("Setting solr.configdir to " + configdir);
        System.setProperty("solr.configdir", configdir);
    }

Note that relative to the original source (at least my version), it's just getInitParameter(), not getServletContext().getInitParameter(), and the name of the parameter is solr.configdir (all lower-case), not solr.configDir.

2. Build and deploy the Solr webapp to Resin. Mine is called solr-notes for this example.

3. In the webapp's web.xml (<resin_root>/webapps/solr-notes/WEB-INF/web.xml):

a. Uncomment out the first three system-property lines (as noted in the comment, to work around a bug in Resin)

b. Add an init-param to the servlet section:

  <servlet>
    <servlet-name>SolrServer</servlet-name>
    <display-name>Solr</display-name>
    <description>Solr Server</description>
    <servlet-class>org.apache.solr.servlet.SolrServlet</servlet-class>
    <load-on-startup>0</load-on-startup>
    <init-param solr.configdir="./webapps/solr-notes/conf/"/>
  </servlet>

4. Copy the contents of the Solr config directory to <resin_root>/webapps/solr-notes/conf. As part of this, you can edit solrconfig.xml to specify the location of the data directory as:

  <dataDir>./webapps/solr-notes/data/</dataDir>

5. Repeat steps 2 - 4 for the second webapp, with a different name.

-- Ken
--
Ken Krugler
Krugle, Inc.
+1 530-210-6378
"Find Code, Find Answers"

Reply via email to