1 .. include:: images.rst
6 `Introduction <#sopacintro>`__
7 ------------------------------
9 This is an installation guide for SOPAC2 and its Koha connector. It has
10 been tested on Debian Lenny and Ubuntu Jaunty with Drupal 6.12 and Koha
11 3.0.x. It does not cover the installation of Koha and Drupal, only
12 SOPAC, its dependencies and the connector.
14 `Installation of Locum and Insurge <#sopacinstall>`__
15 -----------------------------------------------------
17 Locum and Insurge are the two libraries used primarily by SOPAC. They
18 serve as a layer of abstraction to the data. Insurge manages the social
19 aspect (tags, reviews, ratings), while Locum manages the connection to
20 the ILS via the connector. Both libraries use a different database from
23 `Dependencies <#sopacdepend>`__
24 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26 There are no packages for Debian MDB2 yet, you can install it via pear:
30 # apt-get install php-pear
32 # pear install MDB2#mysql
34 `Download <#sopacdownload>`__
35 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 Download the Locum and Insurge libraries from SVN:
42 # svn co http://dobby.darienlibrary.org/svn/locum/trunk/ locum
43 # svn co http://dobby.darienlibrary.org/svn/insurge/trunk/ insurge
45 `Creation of the Database <#sopaccreatedb>`__
46 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
51 mysql> create database scas;
52 mysql> grant all privileges on scas.* to scas_user@'localhost' identified by 'scas_pass';
53 mysql> flush privileges;
56 `Sync DSN <#sopacdsn>`__
57 ~~~~~~~~~~~~~~~~~~~~~~~~
59 This file will provide the connection information to a DB libraries:
63 # nano /usr/local/etc/locum_insurge_dsn.php
70 $dsn = 'mysql://scas_user:scas_pass@localhost/scas';
72 `Installation of Insurge <#sopacinstallinsurge>`__
73 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75 If you customize the name of the database, remember to edit the sql
80 # nano /usr/local/lib/insurge/sql/scas_insurge.sql
86 $ mysql -u root -p < /usr/local/lib/insurge/sql/scas_insurge.sql
92 # nano /usr/local/lib/insurge/config/insurge.ini
94 The variables in insurge.ini are empty. The default values are too long
95 and cause MySQL errors.
97 Here is a sample of insurge.ini
101 ; This is the Locum configuration file
102 ; General configuration options for your installation of Insurge.
104 dsn_file = "/usr/local/etc/locum_insurge_dsn.php"
105 ; This is where you configure your repository membership information.
107 ; parent_server is the server name of the repository parent server you have been
109 ; group_id = The group ID you have been given by your repository admin.
110 ; These configuration points are OPTIONAL and are only necessary if you are
111 ; participating in a repository relationship.
117 `Installation of Locum <#sopacinstallocum>`__
118 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
120 The same procedure applies to Locum
124 # nano /usr/local/lib/locum/sql/scas_locum.sql
125 # mysql < /usr/local/lib/locum/sql/scas_locum.sql
126 # nano /usr/local/lib/locum/sql/locum_init.sql
127 # mysql < /usr/local/lib/locum/sql/locum_init.sql
128 # nano /usr/local/lib/locum/config/locum.ini
129 # mkdir /usr/local/var
130 # mkdir /usr/local/var/log
137 dsn_file = "/usr/local/etc/locum_insurge_dsn.php"
139 And the information for your Koha installation:
146 ils_server = "localhost"
147 ils_harvest_port = "80"
149 The rest depends on your Koha configuration.
151 `Installation of Koha Connector <#sopackoha>`__
152 -----------------------------------------------
154 Download the Koha connector using SVN:
158 # cd /usr/local/lib/locum/connectors/
159 # svn co http://dobby.darienlibrary.org/svn/connectors/koha/ locum_koha_30x
161 `Harvest Records <#sopacharvest>`__
162 -----------------------------------
164 Now that the connector is in place, we will be able to launch
165 harvest.php, a tool that will reap Locum DB Koha and fill the locum.
167 Start by configuring harvest.php:
171 # nano /usr/local/lib/locum/tools/harvest.php
173 Here are the variables you must change:
180 These are the minimum and maximum biblionumbers from your Koha install.
182 Then start the harvest:
186 # chmod +x /usr/local/lib/locum/tools/harvest.php
187 $ /usr/local/lib/locum/tools/harvest.php
189 `Installation of Sphinx <#sopacphinx>`__
190 ----------------------------------------
192 Sphinx is the indexer for the database used by Locum and Insurge.
194 `Dependencies <#sphinxdepend>`__
195 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
197 There is no Debian package for Sphinx so you'll have to compile the
202 # apt-get install g++ make libmysql++-dev
204 `Download and Compile <#sphinxdownload>`__
205 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
209 $ wget http://sphinxsearch.com/downloads/sphinx-0.9.8.tar.gz
210 $ tar zxvf sphinx-0.9.8.tar.gz
212 $ ./configure --prefix=/usr/local/sphinx
215 # mkdir /usr/local/sphinx
216 # mkdir /usr/local/sphinx/lib
217 # cp api/sphinxapi.php /usr/local/sphinx/lib/
218 $ rm -R sphinx-0.9.8*
220 `Creation of User and Group <#sphinxuser>`__
221 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
223 Creating a Sphinx user and change the owner:
229 # usermod -G sphinx sphinx
230 # mkdir /usr/local/sphinx/var/run
231 # chown -R sphinx.sphinx /usr/local/sphinx/var
233 `The Sphinx daemon <#demonsphinx>`__
234 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
241 # wget http://www.thesocialopac.net/sites/thesocialopac.net/files/sphinx
242 # chmod +x /etc/init.d/sphinx
244 Add Sphinx to the default boot services:
248 # update-rc.d sphinx defaults
250 `Configuration <#sphinxconfig>`__
251 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
253 Copy the configuration file supplied with the source of Sphinx before
258 # cp /usr/local/lib/locum/sphinx/sphinx.conf /usr/local/sphinx/etc/
259 # sed 's/locum_db_user/scas_user/g' /usr/local/sphinx/etc/sphinx.conf > tmpfile;
260 mv tmpfile /usr/local/sphinx/etc/sphinx.conf
261 # sed 's/locum_db_pass/scas_pass/g' /usr/local/sphinx/etc/sphinx.conf > tmpfile; mv tmpfile /usr/local/sphinx/etc/sphinx.conf
263 And if you personalize the name of the database:
267 # sed 's/scas/MY_DB/g' /usr/local/sphinx/etc/sphinx.conf > tmpfile; mv tmpfile /usr/local/sphinx/etc/sphinx.conf
269 `Indexing documents <#sphinxindexing>`__
270 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
272 Indexing is necessary if you want to use the search features of SOPAC.
274 You must first complete the Insurge table index
278 # chmod +x /usr/local/lib/insurge/tools/update-index.php
279 $ /usr/local/lib/insurge/tools/update-index.php
281 Then start indexing Sphinx
285 $ /usr/local/sphinx/bin/indexer --all
287 Finally, we must start the daemon:
291 # /etc/init.d/sphinx start
293 When the daemon is running, you can update the index with:
297 $ /usr/local/sphinx/bin/indexer --all --rotate
299 `Installation of SOPAC2 <#installsopac>`__
300 ------------------------------------------
302 Now to the SOPAC software itself:
304 `Download <#downloadsopac>`__
305 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
311 $ cd /chemin/vers/drupal/sites/all/
314 $ svn co http://dobby.darienlibrary.org/svn/sopac/trunk/ sopac
316 `Installation <#sopacinstallation>`__
317 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
319 In Drupal's administration settings, activate the module. Also, enable
328 The Drupal menu should now list these entries.
330 `Configuration <#configsopac>`__
331 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
333 Then go into the settings of SOPAC.
335 - Configure the paths to the Locum and Insurge libraries
337 - Choose a URL prefix SOPAC, in my "catalog". Create a node with
343 print sopac_search_form('both');
344 print theme('pages_catalog');
346 - Check the Input Format "PHP Code"
348 - Check Move to front page
350 - In URL path settings, set the SOPAC URL prefix you have chosen.
352 Go to the root of Drupal, a search form will appear.
354 Remember to empty Drupal's cache when something does not work.
356 Drupal offers a few blocks, which are not configured by default. You
357 must specify on which page they should appear.