1 .. include:: images.rst
6 .. _introduction-label:
9 ------------------------------
11 This is an installation guide for SOPAC2 and its Koha connector. It has
12 been tested on Debian Lenny and Ubuntu Jaunty with Drupal 6.12 and Koha
13 3.0.x. It does not cover the installation of Koha and Drupal, only
14 SOPAC, its dependencies and the connector.
16 .. _installation-of-locum-and-insurge-label:
18 Installation of Locum and Insurge
19 -----------------------------------------------------
21 Locum and Insurge are the two libraries used primarily by SOPAC. They
22 serve as a layer of abstraction to the data. Insurge manages the social
23 aspect (tags, reviews, ratings), while Locum manages the connection to
24 the ILS via the connector. Both libraries use a different database from
27 .. _dependencies-label:
30 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 There are no packages for Debian MDB2 yet, you can install it via pear:
36 # apt-get install php-pear
38 # pear install MDB2#mysql
43 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45 Download the Locum and Insurge libraries from SVN:
50 # svn co http://dobby.darienlibrary.org/svn/locum/trunk/ locum
51 # svn co http://dobby.darienlibrary.org/svn/insurge/trunk/ insurge
53 .. _creation-of-the-database-label:
55 Creation of the Database
56 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61 mysql> create database scas;
62 mysql> grant all privileges on scas.* to scas_user@'localhost' identified by 'scas_pass';
63 mysql> flush privileges;
69 ~~~~~~~~~~~~~~~~~~~~~~~~
71 This file will provide the connection information to a DB libraries:
75 # nano /usr/local/etc/locum_insurge_dsn.php
82 $dsn = 'mysql://scas_user:scas_pass@localhost/scas';
84 .. _installation-of-insurge-label:
86 Installation of Insurge
87 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
89 If you customize the name of the database, remember to edit the sql
94 # nano /usr/local/lib/insurge/sql/scas_insurge.sql
100 $ mysql -u root -p < /usr/local/lib/insurge/sql/scas_insurge.sql
106 # nano /usr/local/lib/insurge/config/insurge.ini
108 The variables in insurge.ini are empty. The default values are too long
109 and cause MySQL errors.
111 Here is a sample of insurge.ini
115 ; This is the Locum configuration file
116 ; General configuration options for your installation of Insurge.
118 dsn_file = "/usr/local/etc/locum_insurge_dsn.php"
119 ; This is where you configure your repository membership information.
121 ; parent_server is the server name of the repository parent server you have been
123 ; group_id = The group ID you have been given by your repository admin.
124 ; These configuration points are OPTIONAL and are only necessary if you are
125 ; participating in a repository relationship.
131 .. _installation-of-locum-label:
133 Installation of Locum
134 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
136 The same procedure applies to Locum
140 # nano /usr/local/lib/locum/sql/scas_locum.sql
141 # mysql < /usr/local/lib/locum/sql/scas_locum.sql
142 # nano /usr/local/lib/locum/sql/locum_init.sql
143 # mysql < /usr/local/lib/locum/sql/locum_init.sql
144 # nano /usr/local/lib/locum/config/locum.ini
145 # mkdir /usr/local/var
146 # mkdir /usr/local/var/log
153 dsn_file = "/usr/local/etc/locum_insurge_dsn.php"
155 And the information for your Koha installation:
162 ils_server = "localhost"
163 ils_harvest_port = "80"
165 The rest depends on your Koha configuration.
167 .. _installation-of-koha-connector-label:
169 Installation of Koha Connector
170 -----------------------------------------------
172 Download the Koha connector using SVN:
176 # cd /usr/local/lib/locum/connectors/
177 # svn co http://dobby.darienlibrary.org/svn/connectors/koha/ locum_koha_30x
179 .. _harvest-records-label:
182 -----------------------------------
184 Now that the connector is in place, we will be able to launch
185 harvest.php, a tool that will reap Locum DB Koha and fill the locum.
187 Start by configuring harvest.php:
191 # nano /usr/local/lib/locum/tools/harvest.php
193 Here are the variables you must change:
200 These are the minimum and maximum biblionumbers from your Koha install.
202 Then start the harvest:
206 # chmod +x /usr/local/lib/locum/tools/harvest.php
207 $ /usr/local/lib/locum/tools/harvest.php
209 .. _installation-of-sphinx-label:
211 Installation of Sphinx
212 ----------------------------------------
214 Sphinx is the indexer for the database used by Locum and Insurge.
216 .. _dependencies-label:
219 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
221 There is no Debian package for Sphinx so you'll have to compile the
226 # apt-get install g++ make libmysql++-dev
228 .. _download-and-compile-label:
231 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
235 $ wget http://sphinxsearch.com/downloads/sphinx-0.9.8.tar.gz
236 $ tar zxvf sphinx-0.9.8.tar.gz
238 $ ./configure --prefix=/usr/local/sphinx
241 # mkdir /usr/local/sphinx
242 # mkdir /usr/local/sphinx/lib
243 # cp api/sphinxapi.php /usr/local/sphinx/lib/
244 $ rm -R sphinx-0.9.8*
246 .. _creation-of-user-and-group-label:
248 Creation of User and Group
249 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
251 Creating a Sphinx user and change the owner:
257 # usermod -G sphinx sphinx
258 # mkdir /usr/local/sphinx/var/run
259 # chown -R sphinx.sphinx /usr/local/sphinx/var
261 .. _the-sphinx-daemon-label:
264 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
271 # wget http://www.thesocialopac.net/sites/thesocialopac.net/files/sphinx
272 # chmod +x /etc/init.d/sphinx
274 Add Sphinx to the default boot services:
278 # update-rc.d sphinx defaults
280 .. _configuration-label:
283 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
285 Copy the configuration file supplied with the source of Sphinx before
290 # cp /usr/local/lib/locum/sphinx/sphinx.conf /usr/local/sphinx/etc/
291 # sed 's/locum_db_user/scas_user/g' /usr/local/sphinx/etc/sphinx.conf > tmpfile;
292 mv tmpfile /usr/local/sphinx/etc/sphinx.conf
293 # sed 's/locum_db_pass/scas_pass/g' /usr/local/sphinx/etc/sphinx.conf > tmpfile; mv tmpfile /usr/local/sphinx/etc/sphinx.conf
295 And if you personalize the name of the database:
299 # sed 's/scas/MY_DB/g' /usr/local/sphinx/etc/sphinx.conf > tmpfile; mv tmpfile /usr/local/sphinx/etc/sphinx.conf
301 .. _indexing-documents-label:
304 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
306 Indexing is necessary if you want to use the search features of SOPAC.
308 You must first complete the Insurge table index
312 # chmod +x /usr/local/lib/insurge/tools/update-index.php
313 $ /usr/local/lib/insurge/tools/update-index.php
315 Then start indexing Sphinx
319 $ /usr/local/sphinx/bin/indexer --all
321 Finally, we must start the daemon:
325 # /etc/init.d/sphinx start
327 When the daemon is running, you can update the index with:
331 $ /usr/local/sphinx/bin/indexer --all --rotate
333 .. _installation-of-sopac2-label:
335 Installation of SOPAC2
336 ------------------------------------------
338 Now to the SOPAC software itself:
343 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
349 $ cd /chemin/vers/drupal/sites/all/
352 $ svn co http://dobby.darienlibrary.org/svn/sopac/trunk/ sopac
354 .. _installation-label:
357 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
359 In Drupal's administration settings, activate the module. Also, enable
368 The Drupal menu should now list these entries.
370 .. _configuration-label:
373 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
375 Then go into the settings of SOPAC.
377 - Configure the paths to the Locum and Insurge libraries
379 - Choose a URL prefix SOPAC, in my "catalog". Create a node with
385 print sopac_search_form('both');
386 print theme('pages_catalog');
388 - Check the Input Format "PHP Code"
390 - Check Move to front page
392 - In URL path settings, set the SOPAC URL prefix you have chosen.
394 Go to the root of Drupal, a search form will appear.
396 Remember to empty Drupal's cache when something does not work.
398 Drupal offers a few blocks, which are not configured by default. You
399 must specify on which page they should appear.