Create Solr Startup Files

To create the necessary Solr startup files:

  1. Create a Solr core folder and core.properties file as follows:

    #  mkdir -p /var/lib/escenic/solr/solr-core
    #  cat > /var/lib/escenic/solr/solr-core/core.properties <<EOF
    name=solr-core
    config=solrconfig.xml
    schema=schema.xml
    dataDir=data
    EOF

    where solr-core is the name of your Solr core. Typically you might choose to use either editorial or presentation as the name of your core depending on its purpose (that is, what kind of host you are installing it on).

  2. Change ownership of the Solr folder and all its contents, so that it can be used by the escenic user:

    # chown -R escenic:escenic /var/lib/escenic/solr
  3. Create a configuration file for the /opt/solr/bin/solr startup script. Do this by moving (not copying) the file as follows:

    # mv /opt/solr/bin/solr.in.sh /etc/default/
  4. Append settings for SOLR_HOME, SOLR_LOGS_DIR and SOLR_PID_DIR to the moved script as shown below:

    # cat >> /etc/default/solr.in.sh <<EOF
    SOLR_HOME=/var/lib/escenic
    SOLR_LOGS_DIR=/var/log/escenic
    SOLR_PID_DIR=/var/run/escenic
    EOF

    This will ensure that Solr looks for the core in the right place (where you created it in step 1) and writes log files and runtime files to the same locations as corresponding Content Store files.

  5. Make sure that all the folders you specified in step 4 actually exist and that the escenic user is either the owner or has read/write permissions.

  6. Add an init.d script for starting Solr automatically on boot:

    # cp /opt/solr/bin/init.d/solr /etc/init.d/
    # sed -i "s#RUNAS=\"solr\"#RUNAS=\"escenic\"#" /etc/init.d/solr
  7. Add the init.d script to the desired run levels. For Debian- and Ubuntu-based systems, you can do this as follows:

    # update-rc.d solr defaults 35

    For other systems, please consult the appropriate documentation.