Archive for the ‘linux’ category

Vufind 0.6 on Ubuntu 7.10

October 30, 2007

Update: The instructions on installing Vufind have been moved to the Vufind Wiki. Please check there for the most up-to-date instructions.

This is an update to my previous post on configuring Ubuntu to run Vufind…

First, upgrade your server distribution to the latest-and-greatest

sudo apt-get dist-upgrade

If you’re on Edgy (7.04), this may take a while. Next install the Java 6 JDK and build-essential (for building Yaz).

sudo apt-get -y install sun-java6-jdk build-essential

When you’re prompted, answer the questions and let Ubuntu finish setting up Java. As a side note, the reason you want the JDK and not the JRE is that we want to run the Solr instance with a server switch to improve the performance. To do this, you need to the JDK.

Next, we install Apache2 and configure the mod_rewrite extension (and reload Apache2):

sudo apt-get -y install apache2
sudo a2enmod rewrite
sudo /etc/init.d/apache2 force-reload

Now, to download Vufind:

wget http://downloads.sourceforge.net/vufind/VuFind-0.6.1.tar.gz?use_mirror=superb-east
tar zxvf VuFind-0.6.1.tar.gz

Now, we need to move the Vufind files to the proper location. By default this should be /usr/local/vufind. If you choose a different location, you’ll need to set an environmental variable for VUFIND_HOME that points to your installation location, but I’ll get more into that a bit later. You also need to change the permissions on the compile and cache folders in the web/interface folder.

sudo mv vufind-0.6.1 /usr/local/vufind
sudo chown www-data:www-data /usr/local/vufind/web/interface/compile
sudo chown www-data:www-data /usr/local/vufind/web/interface/cache

Now to work install MySQL

sudo apt-get -y install mysql-server

PHP5 is required for Vufind with several dependencies.

sudo apt-get -y install php5 php5-dev php-pear php5-ldap php5-mysql php5-xsl php5-pspell aspell aspell-en

I don’t have an Oracle backend, so I haven’t tested the installation of the pdo-oci driver listed in the “official” documentation, but this page will hopefully walk you through installing the driver.

Lastly, we need the Yaz library.

cd /tmp
wget http://ftp.indexdata.dk/pub/yaz/yaz-3.0.14.tar.gz
tar -zxvf yaz-3.0.14.tar.gz
cd yaz-3.0.14
./configure
make
sudo make install

Ok, we’re now finished with adding the packages to get Vufind running. It’s time to run the installation script.

sudo /usr/local/vufind/install

You’ll be walked through the configuration of your Vufind instance. There’s a slight issue in the the database setup script as it assumes you haven’t set a root password (you actually set a password when you set up MySQL in Gutsy now). No biggy, just let the script run through the installation of the PEAR libraries and we’ll fix it with the following:

mysql -u root -p
GRANT ALL ON vufind.* TO vufind@localhost IDENTIFIED BY “secretPassword”;
quit

Now we need to edit a few files. First, we’ll edit /usr/local/vufind/web/conf/config.ini. The big sections that need editing are Site, Amazon, and Catalog (though you probably want to take a look at LDAP too). The Amazon id is your web services access id (not your affiliate ID) and you much change your drive to the appropriate driver that you’re using (e.g. Voyager, SirsiDynix, Koha, Evergreen, Aleph).

Next, the /usr/local/vufind/web/.htaccess file. You’ll need to change the rewrite base. And, you’ll most likely need to tweak the RewriteRule lines for your specific institution. The default is to use numeric call numbers, but if you’re like us, we have OCLC numbers, and many others. In case you’re not a RegEx expert, these are the settings I use:

RewriteRule ^([^/]+)/([a-zA-Z]*[0-9\s]+)/(.+)$
RewriteRule ^([^/]+)/([a-zA-Z]+[0-9\s]+)$
RewriteRule ^([^/]+)/([^0-9/]+)$

We’re almost there!

By default, the Ubuntu Apache2 distribution ignores .htaccess files, so we need to configure Apache to actually use the file. Edit the /etc/apache2/apache2.conf file with the following:

Alias /vufind /usr/local/vufind/web

<Directory /usr/local/vufind/web/>
AllowOverride ALL
Order allow,deny
allow from all
</Directory>

And reload Apache

sudo /etc/init.d/apache2 reload

Ok, let’s check to make sure that the interface is working before we do the final installation of the Solr backend. If you point your browser to http:<your_server>/vufind, you should see the default template. You should see a message on the page stating “Hey! You should customize this space.” If you see a message, you’ll need to do a little debugging (just read the message).

Ok, now for Solr. Vufind is packaged with Solr and Jetty. And, before we get going, we need to set an environmental variable JAVA_HOME. The way I do it is by adding the following line to /etc/profile

JAVA_HOME="/usr/lib/jvm/java-6-sun"
export JAVA_HOME

I always reboot, just to make sure that this really takes.

I forgot to change the permissions on startup script when I sent it to Andrew, so you need to make it executable

sudo chmod +x /usr/local/vufind/vufind.sh

And now to fire everything up

sudo /usr/local/vufind/vufind.sh start

Now, we want to make sure that Jetty and Solr start up all the time, so we create a symbolic link into /etc/init.d to the /usr/local/vufind/vufind.sh script and then run the update-rc.d script:

sudo ln -s /usr/local/vufind/vufind.sh /etc/init.d/vufind
sudo update-rc.d vufind defaults

Now, if everything went well, you should be able to check out the Solr interface at http://<your_server&gt;:8080/solr/admin.

With everything running, it’s time to create the index of marc records.

First, export your catalog holdings in marc format and put them in your /usr/local/vufind/import folder. The way I do this is I get the exported files and use scp to copy them to the user account and then sudo mv them to the location:

[On the ILS server]

tar czvf catalog.tar.gz catalog.mrc
scp catalog.tar.gz user@your.vufind.server:~

[On your Ubuntu server]

sudo mv ~/catalog.tar.gz /usr/local/vufind/import
tar zxvf /usr/local/vufind/import/catalog.tar.gz

Now, we need to create the MarcXML file:

sudo touch catalog.xml
sudo yaz-marcdump -f MARC-8 -t UTF-8 -o marcxml catalog.mrc > catalog.xml
sudo php import-solr.php

This is a good time to take a coffee break…or a lunch break…or come back tomorrow ūüėČ Seriously, the import takes a while. There are some big (ok, they’re HUGE) improvements in the speed in which the files are indexed in the Subversion branch, but those haven’t been officially tagged yet, so just be aware that while this is slow, it’s been significantly improved for future releases.

The only thing to do is to tune the JVM.

As always, if you have questions, leave a comment, or join the Vufind lists.

LibraryFind

September 10, 2007

Last week I got pretty frustrated with LibraryFind. My test environment is a virtualized Ubuntu server (7.04) and I was running into all kinds of errors with Yaz. At first, I tried to install the most current version from the source with the “--enable-shared” switch. The source (finally) compiled after I did some dependency resolutions. However, no matter how many different ways I compiled the software, I kept getting errors with the ruby-zoom (now just zoom) package not being able to locate yaz.so.3.

After spending more time that I really should have tracking this down, it turns out that there are some changes to the names of the debian packages. What I ended up doing was reverting to my base snapshot (one of the handiest things in virtual test environments) and installed the yaz packages with

sudo apt-get install yaz libyaz2 libyaz2-dev

Then, when I ran the libraryfind software, it stopped producing an error. ¬†I’m not totally out of the woods yet as I can’t get any of the sources (z39.50 or OAI_PMH) to actually do anything. As soon as I get that part working, I’ll post a setup guide for Ubuntu.

Breaking Windows

August 12, 2007

Wayne and Phil finally convinced me to switch operating systems on my office laptop. Wednesday they gathered around me as I took a deep breath and pressed enter to launch the installation of the Ubuntu version of Linux. Afterwards they led me, rapidly, through the installation of various applications and repositories using the command line interface and using the Synaptic Package Manager. I installed VMserver to run the few Windows applications I need, like the Unicorn client, Workflows. Next I need a book to achieve some independence. Right now it is still “Hey Wayne, how do I …” and “Wayne, why is it doing …”

I copied all my documents to another server prior to installing Ubuntu. From there I burned everything to CD. I find it liberating to be free of all the junk I had installed on my laptop and all the documents I had accumulated but not looked at for years. I still have the documents if I need them but I am greeted by a very clean desktop.

I think I am going to start using Google documents more. I like the ability to quickly share. Ubuntu automatically installs OpenOffice so I can easily create local documents.

Day-by-day use of Ubuntu is nothing I have to think about. I only have seven application icons on my toolbar: Synaptic Package Manager, Firefox, Help, VMserver console, Pidgin, Thunderbird, and a terminal window.

My desktop¬† only has folders with the Unicorn API documentation, and two links to our shared library network drive. One is an ssh link and the other is a Windows share. I only mounted the Windows share because there were some permissions issues when I was transferring files around. These links give me very quick access my folders and documents stored on the library’s shared network drive.

Before Ubuntu, I was not able to get a connection to my home wireless network. No matter what steps I took, which wizards I used, I couldn’t get a connection. When I brought home my laptop with Ubuntu I was connected in about a minute because that is how long it took to key in my pass code. Amazing.
We will see what unfolds over the next weeks but I’d say that I’m a Linux convert.