gforge-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gforge-commits] gforge/deb-specific install-apache.sh, 1.13.2.2, 1.13.2


From: lo-lan-do
Subject: [Gforge-commits] gforge/deb-specific install-apache.sh, 1.13.2.2, 1.13.2.3
Date: Sat, 10 Jan 2004 15:44:00 -0600

Update of /cvsroot/gforge/gforge/deb-specific
In directory db.perdue.net:/tmp/cvs-serv22150/deb-specific

Modified Files:
      Tag: Branch_3_1
        install-apache.sh 
Log Message:
Cleaned up the Apache installation process so that it works more
generically with apache{,-perl,-ssl} flavours.  Also use
/etc/$flavour/conf.d/ directory (thus removing the hack that changed
the /etc/$flavour/httpd.conf file).


Index: install-apache.sh
===================================================================
RCS file: /cvsroot/gforge/gforge/deb-specific/install-apache.sh,v
retrieving revision 1.13.2.2
retrieving revision 1.13.2.3
diff -u -d -r1.13.2.2 -r1.13.2.3
--- install-apache.sh   22 Nov 2003 17:23:43 -0000      1.13.2.2
+++ install-apache.sh   10 Jan 2004 21:43:58 -0000      1.13.2.3
@@ -14,28 +14,17 @@
 
 case "$1" in
     configure-files)
-       # Make sure Apache sees us
-       if [ -e /etc/apache/httpd.conf ] ; then
-           cp -a /etc/apache/httpd.conf /etc/apache/httpd.conf.gforge-new
-           
-           if ! grep -q "^Include /etc/gforge/httpd.conf" 
/etc/apache/httpd.conf.gforge-new ; then
-               echo "### Next line inserted by GForge install" >> 
/etc/apache/httpd.conf.gforge-new
-               echo "Include /etc/gforge/httpd.conf" >> 
/etc/apache/httpd.conf.gforge-new
-           fi
-       fi
-
-       if [ -e /etc/apache-ssl/httpd.conf ] ; then
-           cp -a /etc/apache-ssl/httpd.conf 
/etc/apache-ssl/httpd.conf.gforge-new
-           perl -pi -e "s/# *LoadModule php4_module/LoadModule php4_module/gi" 
/etc/apache-ssl/httpd.conf.gforge-new
-           perl -pi -e "s/# *LoadModule apache_ssl_module/LoadModule 
apache_ssl_module/gi" /etc/apache-ssl/httpd.conf.gforge-new
-           perl -pi -e "s/# *LoadModule env_module/LoadModule env_module/gi" 
/etc/apache-ssl/httpd.conf.gforge-new
-           perl -pi -e "s/# *LoadModule vhost_alias_module/LoadModule 
vhost_alias_module/gi" /etc/apache-ssl/httpd.conf.gforge-new
-           
-           if ! grep -q "^Include /etc/gforge/httpd.conf" 
/etc/apache-ssl/httpd.conf.gforge-new ; then
-               echo "### Next line inserted by GForge install" >> 
/etc/apache-ssl/httpd.conf.gforge-new
-               echo "Include /etc/gforge/httpd.conf" >> 
/etc/apache-ssl/httpd.conf.gforge-new
+       # Remove old hack to have Apache see us
+       for flavour in apache apache-perl apache-ssl ; do
+           if [ -e /etc/$flavour/httpd.conf ] && grep -q "Include 
/etc/gforge/httpd.conf" /etc/$flavour/httpd.conf ; then
+               cp -a /etc/$flavour/httpd.conf 
/etc/$flavour/httpd.conf.gforge-new
+               pattern=$(basename $0)
+               tmp=$(mktemp /tmp/$pattern.XXXXXX)
+               grep -v "Include /etc/gforge/httpd.conf\|### Next line inserted 
by GForge install" /etc/$flavour/httpd.conf.gforge-new > $tmp
+               cat $tmp > /etc/$flavour/httpd.conf.gforge-new
+               rm -f $tmp
            fi
-       fi
+       done
 
        # Make sure pgsql, ldap and gd are enabled in the PHP config files
        cp -a /etc/php4/apache/php.ini /etc/php4/apache/php.ini.gforge-new
@@ -64,54 +53,41 @@
        ;;
     configure)
        /usr/lib/gforge/bin/prepare-vhosts-file.pl
-       if [ -e /etc/apache/httpd.conf ] ; then
-           /usr/sbin/modules-config apache enable mod_php4
-           /usr/sbin/modules-config apache enable mod_ssl
-           /usr/sbin/modules-config apache enable mod_env
-           /usr/sbin/modules-config apache enable mod_vhost_alias
-       fi
-       if [ -e /etc/apache-perl/httpd.conf ] ; then
-           /usr/sbin/modules-config apache-perl enable mod_php4
-           /usr/sbin/modules-config apache-perl enable mod_ssl
-           /usr/sbin/modules-config apache-perl enable mod_env
-           /usr/sbin/modules-config apache-perl enable mod_vhost_alias
-       fi
-       if [ -e /etc/apache-ssl/httpd.conf ] ; then
-           /usr/sbin/modules-config apache-ssl enable mod_php4
-           /usr/sbin/modules-config apache-ssl enable mod_env
-           /usr/sbin/modules-config apache-ssl enable mod_vhost_alias
-       fi
-       if [ -x /usr/sbin/apache ]; then
-               invoke-rc.d apache restart || true
-       fi
-       if [ -x /usr/sbin/apache-perl ]; then
-               invoke-rc.d apache-perl restart || true
-       fi
-       if [ -x /usr/sbin/apache-ssl ]; then
-               invoke-rc.d apache-ssl restart || true
-       fi
+       for flavour in apache apache-perl apache-ssl ; do
+           if [ -e /etc/$flavour/httpd.conf ] ; then
+               /usr/sbin/modules-config $flavour enable mod_php4
+               if [ $flavour != apache-ssl ] ; then
+                   /usr/sbin/modules-config $flavour enable mod_ssl
+               fi
+               /usr/sbin/modules-config $flavour enable mod_env
+               /usr/sbin/modules-config $flavour enable mod_vhost_alias
+               [ ! -e /etc/$flavour/conf.d/gforge.httpd.conf ] && ln -s 
/etc/gforge/httpd.conf /etc/$flavour/conf.d/gforge.httpd.conf
+           fi
+           if [ -x /usr/sbin/$flavour ]; then
+               invoke-rc.d $flavour restart || true
+           fi
+       done
        ;;
 
     purge-files)
-       cp -a /etc/apache/httpd.conf /etc/apache/httpd.conf.gforge-new
-       if grep -q "Include /etc/gforge/httpd.conf" 
/etc/apache/httpd.conf.gforge-new ; then
-           pattern=$(basename $0)
-           tmp=$(mktemp /tmp/$pattern.XXXXXX)
-           grep -v "Include /etc/gforge/httpd.conf\|### Next line inserted by 
GForge install" /etc/apache/httpd.conf.gforge-new > $tmp
-           cat $tmp > /etc/apache/httpd.conf.gforge-new
-           rm -f $tmp
-       fi
+       for flavour in apache apache-perl apache-ssl ; do
+           if [ -e /etc/$flavour/httpd.conf ] && grep -q "Include 
/etc/gforge/httpd.conf" /etc/$flavour/httpd.conf ; then
+               cp -a /etc/$flavour/httpd.conf 
/etc/$flavour/httpd.conf.gforge-new
+               pattern=$(basename $0)
+               tmp=$(mktemp /tmp/$pattern.XXXXXX)
+               grep -v "Include /etc/gforge/httpd.conf\|### Next line inserted 
by GForge install" /etc/$flavour/httpd.conf.gforge-new > $tmp
+               cat $tmp > /etc/$flavour/httpd.conf.gforge-new
+               rm -f $tmp
+           fi
+       done
        ;;
     purge)
-       if [ -x /usr/sbin/apache ]; then
-               invoke-rc.d apache restart || true
-       fi
-       if [ -x /usr/sbin/apache-perl ]; then
-               invoke-rc.d apache-perl restart || true
-       fi
-       if [ -x /usr/sbin/apache-ssl ]; then
-               invoke-rc.d apache-ssl restart || true
-       fi
+       for flavour in apache apache-perl apache-ssl ; do
+           [ ! -e /etc/$flavour/conf.d/gforge.httpd.conf ] && rm -f 
/etc/$flavour/conf.d/gforge.httpd.conf
+           if [ -x /usr/sbin/$flavour ]; then
+               invoke-rc.d $flavour restart || true
+           fi
+       done
        ;;
 
     *)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]