SITKACONF_BRANCH="master"
SITKATOOLS="/root/sitka-tools"
+THISHOST=`hostname -s`
+
suwrap() {
su -s /bin/bash -c "source ~/.bashrc ; $1" $2
}
chown -R opensrf:opensrf ${INSTALLDIR}
# Apache stuff (as root):
-APACHEFILES="/etc/apache2/eg_vhost.conf /etc/apache2/eg_startup /etc/apache2/sites-available/eg.conf /etc/apache2/envvars"
+APACHEFILES="/etc/apache2/eg_vhost.conf /etc/apache2/eg_startup /etc/apache2/envvars"
for APACHEFILE in ${APACHEFILES}
do
mv ${APACHEFILE} ${APACHEFILE}.bak
cp ${SITKACONF}/files/${APACHEFILE}/${HOSTNAME} ${APACHEFILE}
done
-#a2dissite 000-default
-#a2ensite eg.conf
#if [ ! -d "/etc/apache2/ssl" ]
#then
# mkdir /etc/apache2/ssl
# ensure opensrf can run Apache
chown -R opensrf:opensrf /var/lock/apache2
+# More Apache stuff for non-production sites (we manage this with Puppet on prod)
+if [[ ! -n "$PROD" ]] ; then
+ SITECONFIGS="/etc/apache2/includes/498-ssl-star.catalogue.libraries.coop-include /etc/apache2/includes/499-rewrites.conf-include /etc/apache2/sites-available/eg.conf /etc/apache2/sites-available/499-star.catalogue.libraries.coop.conf"
+ for SITECONFIG in ${SITECONFIGS} ; do
+ mv ${SITECONFIG} ${SITECONFIG}.bak
+ cp ${SITKACONF}/files/${SITECONFIG}/${HOSTNAME} ${SITECONFIG}
+ sed -i "s|__NONPROD__|${THISHOST}|g" ${SITECONFIG}
+ done
+ a2ensite eg.conf
+fi
+
# set up log rotation
if [[ ! -n "$PROD" ]] ; then
if [ ! -f "/etc/logrotate.d/evergreen" ]
if [ ! -e "/etc/cron.d/news" ] ; then cp ${SITKACONF}/files/etc/cron.d/news/${HOSTNAME} /etc/cron.d/news ; fi
else
# nonprod server, auto-update splash page with install info
- THISHOST=`hostname -s`
TODAY=`date +'%A %d %B %Y'`
- sed -i "s/__THISHOST__/${THISHOST}/g" ${INSTALLDIR}/var/web/news/index.html
- sed -i "s/__TODAY__/${TODAY}/g" ${INSTALLDIR}/var/web/news/index.html
- sed -i "s/__VERSION__/${VERSION}/g" ${INSTALLDIR}/var/web/news/index.html
- sed -i "s/__BRANCH__/${BRANCH}/g" ${INSTALLDIR}/var/web/news/index.html
+ sed -i "s|__THISHOST__|${THISHOST}|g" ${INSTALLDIR}/var/web/news/index.html
+ sed -i "s|__TODAY__|${TODAY}|g" ${INSTALLDIR}/var/web/news/index.html
+ sed -i "s|__VERSION__|${VERSION}|g" ${INSTALLDIR}/var/web/news/index.html
+ sed -i "s|__BRANCH__|${BRANCH}|g" ${INSTALLDIR}/var/web/news/index.html
fi
# 8.5 offline patron list