install-eg.sh: clean up Apache config (use new deploykit instead)
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Mon, 22 Jan 2018 20:54:13 +0000 (12:54 -0800)
committerJeff Davis <jdavis@sitka.bclibraries.ca>
Mon, 22 Jan 2018 20:54:13 +0000 (12:54 -0800)
deployment/install-eg.sh

index e1a7839..d71fc4c 100755 (executable)
@@ -86,29 +86,33 @@ cd ${BUILDDIR} && make STAFF_CLIENT_VERSION=${VERSION} STAFF_CLIENT_STAMP_ID=${S
 mv ${INSTALLDIR}/var/web/reports/fm_IDL.xml ${INSTALLDIR}/var/web/reports/fm_IDL.xml.orig && cp ${INSTALLDIR}/conf/fm_IDL.xml ${INSTALLDIR}/var/web/reports/
  
 # Apache stuff (as root):
-APACHEFILES="/etc/apache2/eg_vhost.conf /etc/apache2/eg_startup /etc/apache2/envvars /etc/apache2/mods-available/mpm_prefork.conf"
+APACHEFILES="/etc/apache2/mods-available/mpm_prefork.conf"
 for APACHEFILE in ${APACHEFILES}
 do
   [[ -e "${APACHEFILE}" ]] && mv ${APACHEFILE} ${APACHEFILE}.`date +%Y-%m-%d-%H%M%S`
   cp ${SITKACONF}/files/${APACHEFILE}/${HOSTNAME} ${APACHEFILE}
 done
+cp ${BUILDDIR}/Open-ILS/examples/apache/eg_startup /etc/apache2/eg_startup
+sed -i 's/export APACHE_RUN_USER=www-data/export APACHE_RUN_USER=opensrf/' /etc/apache2/envvars
 a2dismod mpm_event
 a2enmod mpm_prefork
+a2enmod headers
 # 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)
+# More Apache stuff for non-production sites
 if [[ ! -n "$PROD" ]] ; then
   if [ ! -d "/etc/apache2/includes" ] ; then
     mkdir /etc/apache2/includes
   fi
-  SITECONFIGS="/etc/apache2/includes/498-ssl-star.catalogue.libraries.coop-include /etc/apache2/includes/499-rewrites.conf-include /etc/apache2/includes/default.conf-include /etc/apache2/sites-available/eg.conf /etc/apache2/sites-available/499-star.catalogue.libraries.coop.conf /etc/apache2/sites-available/test-server.conf"
+  SITECONFIGS="/etc/apache2/sites-available/test-server.conf"
   for SITECONFIG in ${SITECONFIGS} ; do
-    mv ${SITECONFIG} ${SITECONFIG}.bak
     cp ${SITKACONF}/files/${SITECONFIG}/${HOSTNAME} ${SITECONFIG}
     sed -i "s|__NONPROD__|${THISHOST}|g" ${SITECONFIG}
     sed -i "s|__VERSION__|${VERSION}|g" ${SITECONFIG}
   done
+  a2ensite test-server.conf
+  a2dissite 000-default
   if [ ! -d "/etc/apache2/ssl/libraries.coop/star.catalogue.libraries.coop" ]
   then
     mkdir -p /etc/apache2/ssl/libraries.coop/star.catalogue.libraries.coop
@@ -116,9 +120,6 @@ if [[ ! -n "$PROD" ]] ; then
     cp ${SITKACONF}/files/etc/ssl/apache2/star.catalogue.libraries.coop/star.catalogue.libraries.coop.key /etc/apache2/ssl/libraries.coop/star.catalogue.libraries.coop/star_catalogue_libraries_coop.key
     cp ${SITKACONF}/files/etc/ssl/apache2/star.catalogue.libraries.coop/star.catalogue.libraries.coop.ca /etc/apache2/ssl/libraries.coop/star.catalogue.libraries.coop/star_catalogue_libraries_coop.ca
   fi
-  a2ensite eg.conf
-  a2ensite 499-star.catalogue.libraries.coop.conf
-  a2ensite test-server.conf
 fi
 
 # websockets config