Table of Contents
Remote Solr Back-end
This page is currently out of date; these instructions apply to VuFind 2.x but need to be updated for the changes introduced during the Solr 5 upgrade in VuFind 3.0.
You may find that you want to install VuFind's front-end on one server (e.g. campus shared hosting) while Solr resides on another. Here are some options (based on Ubuntu 14.04, but hopefully adaptable).
For whichever option, you must make sure that wherever you're running import-marc.sh
has the right host information for solr.hosturl
in import/import.properties
.
1: VuFind's embedded Jetty
This is the simplest. Install default-jre-headless
(or equivalent), and either
- extract/clone VuFind to
/usr/local/vufind2
, or - create that directory and copy
vufind.sh
andsolr/
into it.
Now, since I would be remiss to tell you to run vufind.sh
as root, make a user for it:
adduser --system --group --home /usr/local/vufind2/solr vf2solr chown -R vf2solr:vf2solr /usr/local/vufind2/solr
and you can then start Solr with
sudo -u vf2solr /usr/local/vufind2/vufind.sh
Start on boot
You'll need to edit vufind.sh
or otherwise prevent it from failing when it can't write to /dev/tty
. Then:
cat >/etc/init.d/vf2solr <<END #!/bin/sh cd /usr/local/vufind2/solr sudo -u vf2solr /usr/local/vufind2/vufind.sh "\$@" END chmod +x /etc/init.d/vf2solr update-rc.d vf2solr defaults
2: System servlet container
Minimally
At minimum, this involves something like:
- installing
tomcat7
(orjetty8
), - linking
solr.war
into its webapps directory, chown
ing thesolr
directory totomcat7
(orjetty8
), and- editing
/etc/default/{tomcat7,jetty8}
to pointsolr.solr.home
at it.
Fancier
You can create a more segregated directory structure with the following:
mkdir -p /usr/local/etc/solr/cores cp solr/solr.xml /usr/local/etc/solr/solr.xml cp -r solr/{authority,biblio,reserves,stats,website} /usr/local/etc/solr/cores mkdir -p /var/local/lib/solr cp -r solr/lib /usr/local/lib/solr mkdir -p /usr/local/share/solr ln -s /usr/local/etc/solr/solr.xml /usr/local/share/solr/solr.xml ln -s /usr/local/etc/solr/cores /usr/local/share/solr/cores ln -s /var/local/lib/solr /usr/local/share/solr/data ln -s /usr/local/lib/solr /usr/local/share/solr/lib
The only thing to chown
to tomcat7
(or jetty8
) is /var/local/lib/solr
.
Then edit solr.xml
appropriately, e.g.
<?xml version="1.0" encoding="UTF-8" ?> <solr persistent="false" sharedLib="lib"> <cores adminPath="/admin/multicore"> <core name="biblio" instanceDir="cores/biblio" dataDir="data/biblio" /> <core name="authority" instanceDir="cores/authority" dataDir="data/authority" /> <core name="stats" instanceDir="cores/stats" dataDir="data/stats" /> <core name="reserves" instanceDir="cores/reserves" dataDir="data/reserves" /> <core name="website" instanceDir="cores/website" dataDir="data/website" /> </cores> </solr>
and comment out the dataDir
tags in /usr/local/etc/solr/cores/*/conf/solrconfig.xml
.
Finally, (re)start Tomcat and make sure you're getting data directories for each of your cores under /var/local/lib/solr
, and that links to administer your cores appear in the web interface (http://example.edu:8983/solr).
Upstream Solr
If you want to use upstream Solr, the relevant files are solr-$VERSION/dist/solr-$VERSION.war
,
for webapps/solr.war
, and solr-$VERSION/contrib/analysis-extras/{lib,lucene-libs}/*
for /usr/local/lib/solr
.
3: System Solr
Don't. A) it's probably too old (e.g. Ubuntu 14.04 ships 3.6.2), and B) if VuFind upgrades Solr you'll want to be able to upgrade with it.