Code

- Adding lighttpd configuration to Debian package Closes #946
authoropensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 5 May 2010 17:01:41 +0000 (17:01 +0000)
committeropensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 5 May 2010 17:01:41 +0000 (17:01 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@18152 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/debian/99gosa-lighttpd.conf [new file with mode: 0644]
gosa-core/debian/control
gosa-core/debian/gosa.install
gosa-core/debian/gosa.postinst
gosa-core/debian/gosa.postrm

diff --git a/gosa-core/debian/99gosa-lighttpd.conf b/gosa-core/debian/99gosa-lighttpd.conf
new file mode 100644 (file)
index 0000000..858c65b
--- /dev/null
@@ -0,0 +1,29 @@
+# lighttpd configuration for GOsa
+
+# Set alias to http://<host>/gosa/
+alias.url += (
+       "/gosa/" => "/usr/share/gosa/html/"
+)
+
+# Enable FastCGI and set it to handle .php URLs
+# php-cgi is run with the GOsa-required options
+server.modules += ( "mod_fastcgi" )
+
+$HTTP["url"] =~ "^/gosa/" {
+       fastcgi.server = ( ".php" =>
+               ((
+                       "bin-path" => "/usr/bin/php-cgi -d expose_php=Off -d magic_quotes_gpc=On",
+                       "socket" => "/tmp/php.socket",
+                       "max-procs" => 2,
+                       "idle-timeout" => 20,
+                       "bin-environment" => ( 
+                               "PHP_FCGI_CHILDREN" => "4",
+                               "PHP_FCGI_MAX_REQUESTS" => "10000"
+                       ),
+                       "bin-copy-environment" => (
+                               "PATH", "SHELL", "USER"
+                       ),
+                       "broken-scriptfilename" => "enable"
+               ))
+       )
+}
index eaa430935dca7627c7da750dfcbb24756367b7e4..704bc92cae79174f4994bffcc265290a97b963b8 100644 (file)
@@ -13,7 +13,7 @@ DM-Upload-Allowed: yes
 
 Package: gosa
 Architecture: all
-Depends: php5, php5-cli, apache2-mpm-prefork, exim4 | mail-transport-agent, php5-gd, php5-imap, php5-ldap, php5-mcrypt, php5-mysql, php5-imagick | imagemagick (>= 5.4.4.5-1) | graphicsmagick-im-compat, libcrypt-smbhash-perl, smarty, php5-recode, smarty-gettext, smarty-acl-render, gettext, libapache2-mod-php5, ${misc:Depends}
+Depends: php5, php5-cli, apache2-mpm-prefork | lighttpd , exim4 | mail-transport-agent, php5-gd, php5-imap, php5-ldap, php5-mcrypt, php5-mysql, php5-imagick | imagemagick (>= 5.4.4.5-1) | graphicsmagick-im-compat, libcrypt-smbhash-perl, smarty, php5-recode, smarty-gettext, smarty-acl-render, gettext, ${misc:Depends}, libapache2-mod-php5 | php5-cgi
 Suggests: gosa-si-server, cyrus21-imapd (>= 2.1.11), postfix-ldap, slapd, gosa-schema, php5-suhosin, php-apc, php-fpdf
 Description: Web Based LDAP Administration Program
  Provided is access to posix, shadow, samba, proxy, fax, pureftp and
index 1a3408eac2a756175344cc92389170f97cf3d53d..a1c2cedb209c1bea1f0215d13a2ff3df86e4737a 100644 (file)
@@ -7,6 +7,7 @@ locale                          /usr/share/gosa
 plugins                                /usr/share/gosa
 setup                          /usr/share/gosa
 debian/gosa-apache.conf                /etc/gosa
+debian/99gosa-lighttpd.conf    /etc/gosa
 contrib/shells                 /etc/gosa
 contrib/encodings              /etc/gosa
 contrib/openldap/slapd.conf    /usr/share/doc/gosa/slapd.conf-example
index ae1081d9382b71442a7c5841902027606b9ef640..cc4f8a98a09399eca562e0859344cfc5b948c04b 100644 (file)
@@ -3,7 +3,7 @@
 #
 # see: dh_installdeb(1)
 
-set -e
+set -ex
 
 case "$1" in
   configure)
@@ -30,20 +30,60 @@ if [ ! -f /etc/gosa/gosa.secrets ]; then
     chmod 600 /etc/gosa/gosa.secrets
 fi
 
-# Copy GOsa configuration to conf.d directories
-if [ ! -L /etc/apache2/conf.d/gosa.conf ]; then
+if [ -d /etc/apache2/conf.d ]; then
 
-  # Remove old instances of this file
-  if [ -f /etc/apache2/conf.d/gosa.conf ]; then
-    echo "Found old gosa apache configuration in /etc/apache2/conf.d - moving it to gosa.conf.orig..."
-    echo "Please check for changes in /etc/gosa/gosa-apache.conf if you modified this file!"
-    mv /etc/apache2/conf.d/gosa.conf /etc/apache2/conf.d/gosa.conf.orig
+  # Copy GOsa configuration to conf.d directories
+  if [ ! -L /etc/apache2/conf.d/gosa.conf ]; then
+
+    # Remove old instances of this file
+    if [ -f /etc/apache2/conf.d/gosa.conf ]; then
+      echo "Found old gosa apache configuration in /etc/apache2/conf.d - moving it to gosa.conf.orig..."
+      echo "Please check for changes in /etc/gosa/gosa-apache.conf if you modified this file!"
+      mv /etc/apache2/conf.d/gosa.conf /etc/apache2/conf.d/gosa.conf.orig
+    fi
+
+    echo "Making /gosa available in /etc/apache2/conf.d"
+
+    # Add GOsa include file
+    ln -s /etc/gosa/gosa-apache.conf /etc/apache2/conf.d/gosa.conf
+  fi
+  
+  # Add support for RequestHeader
+  a2enmod headers
+
+  # Finally restart servers
+  if [ -x /usr/sbin/invoke-rc.d ]; then
+    invoke-rc.d apache2 reload
+  else
+    /etc/init.d/apache2 reload
   fi
+fi
+
+if [ -d /etc/lighttpd/conf-available ]; then
+
+  # Copy GOsa configuration to conf-available directories /etc/lighttpd/conf-available
+  if [ ! -L /etc/lighttpd/conf-enabled/99gosa-lighttpd.conf ]; then
+
+    # Remove old instances of this file
+    if [ -f /etc/lighttpd/conf-enabled/99gosa-lighttpd.conf ]; then
+      echo "Found old gosa apache configuration in /etc/lighttpd/conf-enabled - moving it to orig.gosa-lighttpd.conf ..."
+      echo "Please check for changes in /etc/lighttpd/conf-available/orig.99gosa-lighttpd.conf if you modified this file!"
+      mv /etc/lighttpd/conf-enabled/99gosa-lighttpd.conf /etc/lighttpd/conf-available/orig.gosa-lighttpd.conf
+    fi
 
-  echo "Making /gosa available in /etc/apache2/conf.d"
+    echo "Making /gosa available in /etc/lighttpd/conf-enabled/"
+
+    # Add GOsa include file
+    ln -s /etc/gosa/99gosa-lighttpd.conf /etc/lighttpd/conf-enabled/99gosa-lighttpd.conf
+  fi
+
+  # Finally restart servers
+  if [ -x /usr/sbin/invoke-rc.d ]; then
+    invoke-rc.d lighttpd reload
+  else
+    /etc/init.d/lighttpd reload
+  fi
 
-  # Add GOsa include file
-  ln -s /etc/gosa/gosa-apache.conf /etc/apache2/conf.d/gosa.conf
 fi
 
 # Add links for safe mode
@@ -61,17 +101,7 @@ chmod 770 -R /var/spool/gosa
 chown root.$WEBGROUP -R /var/cache/gosa
 chmod 770 -R /var/cache/gosa
 
-# Add support for RequestHeader
-a2enmod headers
-
 update-gosa
 
-# Finally restart servers
-if [ -x /usr/sbin/invoke-rc.d ]; then
-  invoke-rc.d apache2 reload
-else
-  /etc/init.d/apache2 reload
-fi
-
 exit 0
 
index 12252fa9166c3781c3ced44d0d85fffe5d08ba6e..8e5b4a1e0bbdd911a90b784e89d97bbda04928e1 100644 (file)
@@ -2,7 +2,7 @@
 # postrm script for GOsa
 #
 
-set -e
+set -ex
 
 case "$1" in
   purge|remove)
@@ -15,17 +15,30 @@ case "$1" in
           fi
         fi
 
-        # Remove GOsa include
-        [ -L /etc/apache2/conf.d/gosa.conf ] && rm -f /etc/apache2/conf.d/gosa.conf
+        if [ -d /etc/apache2/conf.d ]; then
+          # Remove GOsa include
+          [ -L /etc/apache2/conf.d/gosa.conf ] && rm -f /etc/apache2/conf.d/gosa.conf
 
-
-        # Restart servers
-        if [ -x /usr/sbin/invoke-rc.d ]; then
+          # Restart servers
+          if [ -x /usr/sbin/invoke-rc.d ]; then
             invoke-rc.d apache2 restart
-        else
+          else
             /etc/init.d/apache2 restart
+          fi
         fi
 
+        if [ -d /etc/lighttpd/conf-available ]; then
+          # Remove GOsa include
+          [ -L /etc/lighttpd/conf-enabled/99gosa-lighttpd.conf ] && rm -f /etc/lighttpd/conf-enabled/99gosa-lighttpd.conf
+
+          # Restart servers
+          if [ -x /usr/sbin/invoke-rc.d ]; then
+            invoke-rc.d lighttpd restart
+          else
+            /etc/init.d/lighttpd restart
+          fi
+        fi
+        
         ;;
 
   upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)