#!/bin/bash # Script for installing VuFind 2.x on Ubuntu # This does not include the OCI8 libraries # Update the profile file to set required environment variables (unless they are # already defined there): grep -q JAVA_HOME= /etc/profile if [ $? -ne 0 ]; then sh -c 'echo export JAVA_HOME=\"/usr/lib/jvm/default-java\" >> /etc/profile' fi grep -q VUFIND_HOME= /etc/profile if [ $? -ne 0 ]; then sh -c 'echo export VUFIND_HOME=\"/usr/local/vufind2\" >> /etc/profile' fi grep -q VUFIND_LOCAL_DIR= /etc/profile if [ $? -ne 0 ]; then sh -c 'echo export VUFIND_LOCAL_DIR=\"\$VUFIND_HOME/local\" >> /etc/profile' fi source /etc/profile # Turn on mod_rewrite in Apache. a2enmod rewrite # Set permissions so Apache can write to certain directories. chown -R www-data:www-data $VUFIND_LOCAL_DIR/cache chown -R www-data:www-data $VUFIND_LOCAL_DIR/config # Set up CLI cache. mkdir $VUFIND_LOCAL_DIR/cache/cli chmod 777 $VUFIND_LOCAL_DIR/cache/cli # Create the Apache configuration cd $VUFIND_HOME php install.php --use-defaults # Set up Apache for VuFind and reload configuration APACHE_CONF_DIR=/etc/apache2/conf.d if [ ! -d $APACHE_CONF_DIR ]; then APACHE_CONF_DIR=/etc/apache2/conf-enabled fi ln -s $VUFIND_LOCAL_DIR/httpd-vufind.conf $APACHE_CONF_DIR/vufind2.conf /etc/init.d/apache2 force-reload