forked from NatLibFi/NDL-VuFind2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostinst
33 lines (26 loc) · 1.09 KB
/
postinst
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# Script for installing VuFind on Ubuntu
# This does not include the OCI8 libraries
# Update the profile file to set required environment variables:
sh -c 'echo export JAVA_HOME=\"/usr/lib/jvm/default-java\" > /etc/profile.d/vufind.sh'
sh -c 'echo export VUFIND_HOME=\"/usr/local/vufind\" >> /etc/profile.d/vufind.sh'
sh -c 'echo export VUFIND_LOCAL_DIR=\"\$VUFIND_HOME/local\" >> /etc/profile.d/vufind.sh'
source /etc/profile.d/vufind.sh
# 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/vufind.conf
/etc/init.d/apache2 force-reload