Zhang Huangbin avatar Zhang Huangbin committed 773c75b

Enable Cluebringer webui on openSUSE-13.1 with libapr-util1-dbd-{mysql,pgsql}.

Comments (0)

Files changed (4)

iRedMail/conf/apache_php

     export HTTPD_LOG_ERRORLOG='/var/log/apache2/error.log'
 
     # ---- PHP ----
-    export PHP_INI='/etc/php5/apache2/php.ini'
-    export PHP_INI_CONF_DIR='/etc/php5/apache2/conf.d/'
+    if [ X"${DISTRO}" == X'DEBIAN' ]; then
+        export PHP_INI='/etc/php5/apache2filter/php.ini'
+        export PHP_INI_CONF_DIR='/etc/php5/apache2filter/conf.d/'
+    else
+        export PHP_INI='/etc/php5/apache2/php.ini'
+        export PHP_INI_CONF_DIR='/etc/php5/apache2/conf.d/'
+    fi
 
 elif [ X"${DISTRO}" == X"FREEBSD" ]; then
     export HTTPD_RC_SCRIPT_NAME='apache22'

iRedMail/functions/cluebringer.sh

         [ X"${LDAP_USE_TLS}" == X"YES" ] && \
             perl -pi -e 's#(AuthLDAPUrl.*)(ldap://)(.*)#${1}ldaps://${3}#' ${CLUEBRINGER_HTTPD_CONF}
 
-        # openSUSE-13.1 (bottle) ships Apache-2.4 which removes directive 'AuthzLDAPAuthoritative'.
+        # openSUSE-13.1 (bottle) and Ubuntu 13.10 ships Apache-2.4 which
+        # removes directive 'AuthzLDAPAuthoritative'.
         [ X"${DISTRO}" == X'SUSE' -a X"${DISTRO_CODENAME}" == X'bottle' ] && \
             perl -pi -e 's/(.*)(AuthzLDAPAuthoritative.*)/${1}#${2}/g' ${CLUEBRINGER_HTTPD_CONF}
 
 
     elif [ X"${BACKEND}" == X"MYSQL" ]; then
         # Use mod_auth_mysql.
-        if [ X"${DISTRO}" == X"RHEL" -o X"${DISTRO}" == X"SUSE" -o X"${DISTRO}" == X"FREEBSD" ]; then
+        if [ X"${DISTRO}" == X"RHEL" -o X"${DISTRO}" == X"FREEBSD" ]; then
             cat >> ${CLUEBRINGER_HTTPD_CONF} <<EOF
     AuthMYSQLEnable On
     AuthMySQLHost ${SQL_SERVER}
             if [ X"${DISTRO}" == X"FREEBSD" ]; then
                 # Enable mod_auth_mysql module in httpd.conf.
                 perl -pi -e 's/^#(LoadModule.*mod_auth_mysql.*)/${1}/' ${HTTPD_CONF}
-            fi
-
-            # openSUSE & FreeBSD special.
-            if [ X"${DISTRO}" == X"SUSE" -o X"${DISTRO}" == X"FREEBSD" ]; then
                 echo "AuthBasicAuthoritative Off" >> ${CLUEBRINGER_HTTPD_CONF}
             fi
 
-        elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
+        elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" -o X"${DISTRO}" == X'SUSE' ]; then
             if [ X"${DISTRO_CODENAME}" == X'wheezy' \
                 -o X"${DISTRO_CODENAME}" == X'precise' \
                 -o X"${DISTRO_CODENAME}" == X'raring' ]; then
 Auth_MySQL_General_DB ${VMAIL_DB}
 EOF
             else
+                # Apache 2.4 with apr-util1-dbd-mysql
                 perl -pi -e 's#(<Directory .*)#DBDriver mysql\n${1}#' ${CLUEBRINGER_HTTPD_CONF}
                 perl -pi -e 's#(<Directory .*)#DBDParams "host=$ENV{SQL_SERVER} port=$ENV{SQL_SERVER_PORT} dbname=$ENV{VMAIL_DB} user=$ENV{VMAIL_DB_BIND_USER} pass=$ENV{VMAIL_DB_BIND_PASSWD}"\n${1}#' ${CLUEBRINGER_HTTPD_CONF}
 
     AuthDBDUserPWQuery "SELECT password FROM mailbox WHERE username=%s AND isglobaladmin=1"
 EOF
 
-                a2enconf zcluebringer &>/dev/null
-                a2enmod authn_dbd &>/dev/null
+                if [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
+                    a2enconf zcluebringer &>/dev/null
+                    a2enmod authn_dbd &>/dev/null
+                fi
             fi
 
             # Set file permission.
         fi  # DISTRO
 
     elif [ X"${BACKEND}" == X"PGSQL" ]; then
-        if [ X"${DISTRO_CODENAME}" == X'saucy' ]; then
+        # openSUSE-13.1 and Ubuntu 13.10
+        if [ X"${DISTRO_CODENAME}" == X'saucy' -o X"${DISTRO_CODENAME}" == X'bottle' ]; then
             perl -pi -e 's#(<Directory .*)#DBDriver pgsql\n${1}#' ${CLUEBRINGER_HTTPD_CONF}
             perl -pi -e 's#(<Directory .*)#DBDParams "host=$ENV{SQL_SERVER} port=$ENV{SQL_SERVER_PORT} dbname=$ENV{VMAIL_DB} user=$ENV{VMAIL_DB_BIND_USER} password=$ENV{VMAIL_DB_BIND_PASSWD}"\n${1}#' ${CLUEBRINGER_HTTPD_CONF}
 
     AuthDBDUserPWQuery "SELECT password FROM mailbox WHERE username=%s AND isglobaladmin=1"
 EOF
 
-            a2enconf cluebringer &>/dev/null
-            a2enmod authn_dbd &>/dev/null
+            if [ X"${DISTRO_CODENAME}" == X'saucy' ]; then
+                a2enconf zcluebringer &>/dev/null
+                a2enmod authn_dbd &>/dev/null
+            fi
         else
             # Use mod_auth_pgsql.
             cat >> ${CLUEBRINGER_HTTPD_CONF} <<EOF

iRedMail/functions/packages.sh

             if [ X"${USE_LOCAL_MYSQL_SERVER}" == X'YES' ]; then
                 ALL_PKGS="${ALL_PKGS} mysql-community-server"
             fi
-            ALL_PKGS="${ALL_PKGS} mysql-community-server-client"
+            ALL_PKGS="${ALL_PKGS} mysql-community-server-client libapr-util1-dbd-mysql"
 
             [ X"${USE_AWSTATS}" == X"YES" ] && ALL_PKGS="${ALL_PKGS} postfix-mysql"
 
                 ALL_PKGS="${ALL_PKGS} mod_auth_pgsql${PKG_ARCH}"
 
         elif [ X"${DISTRO}" == X"SUSE" ]; then
-            ALL_PKGS="${ALL_PKGS} postgresql-server postgresql-contrib postfix-postgresql"
+            ALL_PKGS="${ALL_PKGS} postgresql-server postgresql-contrib postfix-postgresql libapr-util1-dbd-pgsql"
 
         elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
             # postgresql-contrib provides extension 'dblink' used in Roundcube password plugin.

iRedMail/functions/policy_server.sh

         ECHO_INFO "Configure Cluebringer (postfix policy server)."
         check_status_before_run cluebringer_user
         check_status_before_run cluebringer_config
-
-        if [ X"${DISTRO}" != X'SUSE' ]; then
-            # openSUSE-12.3 doesn't have Apache module mod_auth_mysql & mod_auth_pgsql.
-            check_status_before_run cluebringer_webui_config
-        fi
+        check_status_before_run cluebringer_webui_config
     fi
 
     # OpenBSD special
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.