Zhang Huangbin avatar Zhang Huangbin committed 385856b

* Remove unused file: dialog/awstats_config.sh.
* OpenBSD 5.4 support:
+ Enable Awstats.
+ Install and enable PHP module php-pdo_mysql/pgsql for Roundcube webmail.
* Drop support for OpenBSD 5.3.

Comments (0)

Files changed (16)

iRedMail/ChangeLog

 iRedMail-0.8.6:
+    * Works on openSUSE-13.1 milestone 4.
+    * Works on OpenBSD 5.4, plus Awstats support.
+    * Works on Ubuntu 13.10 (saucy). NOTES:
+      - Awstats, Cluebringer webui are not available due to package missing
+        (libapache2-mod-auth-mysql, libapache2-mod-auth-pgsql).
+      - phpLDAPadmin is not available because it cannot be installed at all.
     * Merge per-domain and per-user transport_maps MySQL lookup into one file:
       - Removed: mysql/transport_maps_domain.cf, mysql/transport_maps_user.cf
       - New: mysql/transport_maps.cf
     * Enable Opportunistic TLS support in Postfix when sending mail to remote
       SMTP server (smtp_tls_security_level=may).
       Thanks kotso <admin _at_ co.ge> and vlastikcz for the report.
-    * Works on openSUSE-13.1 milestone 4.
     * Switch from Policyd-1.8 to Cluebringer on all Linux/BSD distributions,
       with easier white/black/greylisting management.
     * Fixed:
         + Add cron job to cleanup expired entries in Cluebringer database.
 
     * Drop support for below releases:
-        + Debian 6 (squeeze)
+        + OpenBSD 5.3. Please use OpenBSD 5.4 (released on 2013-11-01) instead.
+        + Debian 6 (squeeze). Please use Debian 7 (wheezy) instead.
+
+    * Drop support for below Linux distribution:
         + Gentoo
 
     * Package update:

iRedMail/conf/awstats

     # Override default settings.
     export AWSTATS_CONF_WEB="${AWSTATS_CONF_DIR}/awstats.web.conf"
     export AWSTATS_CONF_MAIL="${AWSTATS_CONF_DIR}/awstats.smtp.conf"
+
+elif [ X"${DISTRO}" == X'OPENBSD' ]; then
+    export AWSTATS_HTTPD_ROOT="${HTTPD_SERVERROOT}/awstats/wwwroot"
+    export AWSTATS_ICON_DIR="${AWSTATS_HTTPD_ROOT}/icon"
+    export AWSTATS_CSS_DIR="${AWSTATS_HTTPD_ROOT}/css"
+    export AWSTATS_JS_DIR="${AWSTATS_HTTPD_ROOT}/js"
+    export AWSTATS_CONF_DIR="${AWSTATS_HTTPD_ROOT}/cgi-bin"
+    export AWSTATS_CONF_SAMPLE="${AWSTATS_CONF_DIR}/awstats.model.conf"
+    export AWSTATS_CGI_DIR="${AWSTATS_CONF_DIR}"
+
+    # Override default settings.
+    export AWSTATS_CONF_WEB="${AWSTATS_CONF_DIR}/awstats.web.conf"
+    export AWSTATS_CONF_MAIL="${AWSTATS_CONF_DIR}/awstats.smtp.conf"
 else
     :
 fi

iRedMail/conf/global

 # OpenBSD built-in LDAP daemon
 export ENABLE_BACKEND_LDAPD='NO'
 
-# Enabled components.
-export DIALOG_SELECTABLE_AWSTATS='YES'
-export DIALOG_SELECTABLE_FAIL2BAN='YES'
-export DIALOG_SELECTABLE_PHPLDAPADMIN='YES'
-
 # For better distributed deployment
 #
 # IP address of localhost.
         # Support PGSQL backend on Ubuntu 11.10 and later releases
         export ENABLE_BACKEND_PGSQL='YES'
 
-        # Disable Awstats on Ubuntu 13.10 due to package missing: libapache2-mod-auth-mysql/pgsql
-        if [ X"${DISTRO_CODENAME}" == X'saucy' ]; then
-            export DIALOG_SELECTABLE_AWSTATS='NO'
-            export DIALOG_SELECTABLE_PHPLDAPADMIN='YES'
-        fi
-
         # Unsupported releases.
         #   - 8.04: hardy
         #   - 8.10: intrepid
     fi
 
     export SHELL_BASH='/usr/local/bin/bash'
-
-    export DIALOG_SELECTABLE_FAIL2BAN='NO'
 elif [ X"${KERNEL_NAME}" == X'OPENBSD' ]; then
     export DISTRO='OPENBSD'
     export DISTRO_VERSION="$(uname -r)"
     export RC_CONF_LOCAL='/etc/rc.conf.local'
     export SHELL_BASH='/usr/local/bin/bash'
 
-    # Unsupported release: 5.1, 5.2.
-    if echo "${DISTRO_VERSION}" | grep '^5.[12]' &>/dev/null ; then
+    # Unsupported release: 5.1, 5.2, 5.3.
+    if echo "${DISTRO_VERSION}" | grep '^5.[123]' &>/dev/null ; then
         export UNSUPPORTED_RELEASE='YES'
     fi
 else

iRedMail/dialog/awstats_config.sh

-#!/usr/bin/env bash
-
-# Author:   Zhang Huangbin (zhb _at_ iredmail.org)
-
-#---------------------------------------------------------------------
-# This file is part of iRedMail, which is an open source mail server
-# solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
-#
-# iRedMail is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# iRedMail is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with iRedMail.  If not, see <http://www.gnu.org/licenses/>.
-#---------------------------------------------------------------------
-
-# --------------------------------------------------
-# -------------------- Awstats ---------------------
-# --------------------------------------------------
-
-. ${CONF_DIR}/awstats
-
-if [ X"${BACKEND}" == X"OPENLDAP" \
-    -o X"${BACKEND}" == X"MYSQL" \
-    -o X"${BACKEND}" == X"PGSQL" \
-    ]; then
-    :
-else
-    # Set username for awstats access.
-    while : ; do
-        ${DIALOG} \
-        --title "Specify usernamen for access awstats from web browser" \
-        --inputbox "\
-Please specify username for access awstats from web browser.
-
-EXAMPLE:
-
-    * admin
-
-" 20 76 2>/tmp/awstats_username
-
-        AWSTATS_USERNAME="$(cat /tmp/awstats_username)"
-        [ X"${AWSTATS_USERNAME}" != X"" ] && break
-    done
-
-    echo "export AWSTATS_USERNAME='${AWSTATS_USERNAME}'" >>${IREDMAIL_CONFIG_FILE}
-    rm -f /tmp/awstats_username
-
-    # Set password for awstats user.
-    while : ; do
-        ${DIALOG} \
-        --title "Password for awstats user: ${AWSTATS_USERNAME}" \
-        ${PASSWORDBOX} "\
-Please specify password for awstats user: ${AWSTATS_USERNAME}
-
-WARNING:
-
-    * EMPTY password is *NOT* permitted.
-
-" 20 76 2>/tmp/awstats_passwd
-
-        AWSTATS_PASSWD="$(cat /tmp/awstats_passwd)"
-        [ X"${AWSTATS_PASSWD}" != X"" ] && break
-    done
-
-    echo "export AWSTATS_PASSWD='${AWSTATS_PASSWD}'" >>${IREDMAIL_CONFIG_FILE}
-    rm -f /tmp/awstats_passwd
-fi

iRedMail/dialog/optional_components.sh

 # ----------------------------------------
 # Optional components for special backend.
 # ----------------------------------------
+# Enabled components.
+export DIALOG_SELECTABLE_AWSTATS='YES'
+export DIALOG_SELECTABLE_FAIL2BAN='YES'
+export DIALOG_SELECTABLE_PHPLDAPADMIN='YES'
+
 # Detect selectable menu items
 if [ X"${DISTRO}" == X'SUSE' ]; then
     # openSUSE-12.3 doesn't have mod_auth_mysql and mod_auth_pgsql.
     export DIALOG_SELECTABLE_AWSTATS='NO'
+elif [ X"${DISTRO}" == X'UBUNTU' ]; then
+    # Disable Awstats on Ubuntu 13.10 due to package missing: libapache2-mod-auth-mysql/pgsql
+    if [ X"${DISTRO_CODENAME}" == X'saucy' ]; then
+        export DIALOG_SELECTABLE_AWSTATS='NO'
+        export DIALOG_SELECTABLE_PHPLDAPADMIN='NO'
+    fi
+elif [ X"${DISTRO}" == X'FREEBSD' ]; then
+    export DIALOG_SELECTABLE_FAIL2BAN='NO'
 elif [ X"${DISTRO}" == X'OPENBSD' ]; then
-    # Binary/port Awstats is not available in 5.2 and earlier releases
-    export DIALOG_SELECTABLE_AWSTATS='NO'
+    # Awstats is available on OpenBSD 5.4.
+    if [ X"${DISTRO_VERSION}" == X'5.3' ]; then
+        export DIALOG_SELECTABLE_AWSTATS='NO'
+    fi
 fi
 
 # Construct dialog menu list
     export USE_FAIL2BAN='YES'
     echo "export USE_FAIL2BAN='YES'" >>${IREDMAIL_CONFIG_FILE}
 fi
-
-# Used when you use awstats.
-[ X"${USE_AWSTATS}" == X"YES" ] && . ${DIALOG_DIR}/awstats_config.sh

iRedMail/functions/apache_php.sh

 
         # Create /var/www/dev/*random.
         cd /var/www/dev/ && /dev/MAKEDEV random
+
+        # Enable mod_auth_mysql
+        [ X"${BACKEND}" == X'MYSQL' ] && /usr/local/sbin/mod_auth_mysql-enable &>/dev/null
     fi
 
     # --------------------------
         ln -s /var/www/conf/modules.sample/php-${PHP_VERSION}.conf /var/www/conf/modules/php.conf
 
         # Enable Apache modules
-        for module in fileinfo bz2 imap ldap mcrypt mysql mysqli pgsql pspell gd; do
-            ln -s /etc/php-${PHP_VERSION}.sample/${module}.ini /etc/php-${PHP_VERSION}/${module}.ini
+        for i in $(ls -d /etc/php-${PHP_VERSION}.sample/*); do
+            ln -sf ${i} /etc/php-${PHP_VERSION}/$(basename $i)
         done
     fi
 

iRedMail/functions/awstats.sh

     ECHO_DEBUG "Generate apache config file for awstats: ${AWSTATS_HTTPD_CONF}."
     backup_file ${AWSTATS_HTTPD_CONF}
 
-    # Move awstats.pl to ${AWSTATS_CGI_DIR} on Debian/Ubuntu, so that it won't
-    # conflict with other cgi programs, e.g. mailman.
-    #if [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" -o X"${DISTRO}" == X"SUSE" ]; then
-    #    mkdir -p ${AWSTATS_CGI_DIR}/awstats/ 2>/dev/null
-    #    mv ${AWSTATS_CGI_DIR}/awstats.pl ${AWSTATS_CGI_DIR}/awstats/ 2>/dev/null
-    #    export AWSTATS_CGI_DIR="${AWSTATS_CGI_DIR}/awstats"
-    #fi
-
     # Assign Apache daemon user to group 'adm', so that Awstats cron job can read log files.
-    if [ X"${DISTRO}" == X"DEBIAN" \
-        -o X"${DISTRO}" == X"UBUNTU" \
-        ]; then
+    if [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
         usermod -G adm ${HTTPD_USER} >/dev/null
     fi
 
     #allow from ${LOCAL_ADDRESS}
 
     AuthName "Authorization Required"
+    AuthType Basic
 EOF
 
     ECHO_DEBUG "Setup user auth for awstats: ${AWSTATS_HTTPD_CONF}."
-    if [ X"${BACKEND}" == X"OPENLDAP" ]; then
+    if [ X"${BACKEND}" == X'OPENLDAP'  -o X"${BACKEND}" == X'LDAPD' ]; then
         # Use LDAP auth.
         cat >> ${AWSTATS_HTTPD_CONF} <<EOF
-    AuthType Basic
-
     AuthBasicProvider ldap
     AuthzLDAPAuthoritative   Off
 
         [ X"${DISTRO}" == X'SUSE' -a X"${DISTRO_CODENAME}" == X'bottle' ] && \
             perl -pi -e 's/(.*)(AuthzLDAPAuthoritative.*)/${1}#${2}/g' ${AWSTATS_HTTPD_CONF}
 
-    elif [ X"${BACKEND}" == X"MYSQL" ]; then
+    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'SUSE' \
+            -o X"${DISTRO}" == X'FREEBSD' ]; then
             cat >> ${AWSTATS_HTTPD_CONF} <<EOF
-    AuthType Basic
-
     AuthMYSQLEnable On
     AuthMySQLHost ${SQL_SERVER}
     AuthMySQLPort ${SQL_SERVER_PORT}
     AuthMySQLUserTable mailbox
     AuthMySQLNameField username
     AuthMySQLPasswordField password
-    AuthMySQLUserCondition "isadmin=1 AND isglobaladmin=1"
+    AuthMySQLUserCondition "isglobaladmin=1"
 EOF
 
             # FreeBSD special.
             fi
 
 
-        elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
+        elif [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
             cat >> ${AWSTATS_HTTPD_CONF} <<EOF
-    AuthType Basic
-
     AuthMYSQL on
     AuthBasicAuthoritative Off
     AuthUserFile /dev/null
     AuthMySQL_Empty_Passwords off
     AuthMySQL_Encryption_Types Crypt_MD5
     Auth_MySQL_Authoritative On
-    #AuthMySQLUserCondition "isadmin=1 AND isglobaladmin=1"
+    #AuthMySQLUserCondition "isglobaladmin=1"
 EOF
 
             # Set file permission.
 
             cat >> ${HTTPD_CONF} <<EOF
 # MySQL auth (libapache2-mod-auth-apache2).
-# Global config of MySQL server, username, password.
+# Global config of MySQL server address, username, password.
 Auth_MySQL_Info ${SQL_SERVER} ${VMAIL_DB_BIND_USER} ${VMAIL_DB_BIND_PASSWD}
 Auth_MySQL_General_DB ${VMAIL_DB}
 EOF
+
+        elif [ X"${DISTRO}" == X'OPENBSD' ]; then
+            cat >> ${AWSTATS_HTTPD_CONF} <<EOF
+    Auth_MYSQL on
+    Auth_MySQL_DB ${VMAIL_DB}
+    Auth_MySQL_Password_Table mailbox
+    Auth_MySQL_Username_Field username
+    Auth_MySQL_Password_Field password
+    Auth_MySQL_Empty_Passwords off
+    Auth_MySQL_Where "isglobaladmin=1"
+EOF
+
+            cat >> ${HTTPD_CONF} <<EOF
+# MySQL auth (mod_auth_mysql)
+# Global config of MySQL server address, port number, username, password.
+Auth_MySQL_Info "${SQL_SERVER}:${SQL_SERVER_PORT}" ${VMAIL_DB_BIND_USER} ${VMAIL_DB_BIND_PASSWD}
+EOF
         fi
 
     elif [ X"${BACKEND}" == X"PGSQL" ]; then
         # Use PGSQL auth.
         cat >> ${AWSTATS_HTTPD_CONF} <<EOF
-    AuthType Basic
     Auth_PG_authoritative on
     Auth_PG_host ${SQL_SERVER}
     Auth_PG_port ${SQL_SERVER_PORT}
     Auth_PG_user ${VMAIL_DB_BIND_USER}
     Auth_PG_pwd ${VMAIL_DB_BIND_PASSWD}
     Auth_PG_pwd_table mailbox
-    Auth_PG_pwd_whereclause 'AND isadmin=1 AND isglobaladmin=1'
+    Auth_PG_pwd_whereclause 'AND isglobaladmin=1'
     Auth_PG_uid_field username
     Auth_PG_pwd_field password
     Auth_PG_lowercase_uid on
     Auth_PG_hash_type CRYPT
 EOF
 
-    else
-        # Use basic auth mech.
-        cat >> ${AWSTATS_HTTPD_CONF} <<EOF
-    AllowOverride AuthConfig
-    AuthType Basic
-    AuthUserFile ${AWSTATS_HTPASSWD_FILE}
-EOF
-
-        # Set username, password for web access.
-        htpasswd -bcm ${AWSTATS_HTPASSWD_FILE} "${AWSTATS_USERNAME}" "${AWSTATS_PASSWD}" >/dev/null 2>&1
+        if [ X"${DISTRO}" == X"SUSE" ]; then
+            # Don't enable Awstats since we don't have Apache module mod_auth_pgsql
+            backup_file ${AWSTATS_HTTPD_CONF}
+            rm ${AWSTATS_HTTPD_CONF} &>/dev/null
+        fi
     fi
 
     # Close <Directory> container.
 </Directory>
 EOF
 
-    if [ X"${DISTRO}" == X"SUSE" ]; then
-        if [ X"${BACKEND}" == X'PGSQL' ]; then
-            # Don't enable Awstats since we don't have Apache module mod_auth_pgsql
-            backup_file ${AWSTATS_HTTPD_CONF}
-            rm ${AWSTATS_HTTPD_CONF} &>/dev/null
-        fi
-    fi
-
-    # Make Awstats can be accessed via HTTPS.
-    perl -pi -e 's#( *</VirtualHost>)#Alias /awstats/icon "$ENV{AWSTATS_ICON_DIR}/"\n${1}#' ${HTTPD_SSL_CONF}
-    perl -pi -e 's#( *</VirtualHost>)#Alias /awstatsicon "$ENV{AWSTATS_ICON_DIR}/"\n${1}#' ${HTTPD_SSL_CONF}
-    perl -pi -e 's#( *</VirtualHost>)#ScriptAlias /awstats "$ENV{AWSTATS_CGI_DIR}/"\n${1}#' ${HTTPD_SSL_CONF}
+    # Make Awstats accessible via HTTPS.
+    perl -pi -e 's#^( *</VirtualHost>)#Alias /awstats/icon "$ENV{AWSTATS_ICON_DIR}/"\n${1}#' ${HTTPD_SSL_CONF}
+    perl -pi -e 's#^( *</VirtualHost>)#Alias /awstatsicon "$ENV{AWSTATS_ICON_DIR}/"\n${1}#' ${HTTPD_SSL_CONF}
+    perl -pi -e 's#^( *</VirtualHost>)#ScriptAlias /awstats "$ENV{AWSTATS_CGI_DIR}/"\n${1}#' ${HTTPD_SSL_CONF}
 
     cat >> ${TIP_FILE} <<EOF
 Awstats:

iRedMail/functions/cluebringer.sh

         cp /usr/local/share/policyd2/contrib/httpd/cluebringer-httpd.conf ${CLUEBRINGER_WEBUI_CONF}
 
     # Make Cluebringer accessible via HTTPS.
-    perl -pi -e 's#( *</VirtualHost>)#Alias /cluebringer "$ENV{CLUEBRINGER_HTTPD_ROOT}/"\n${1}#' ${HTTPD_SSL_CONF}
+    perl -pi -e 's#^( *</VirtualHost>)#Alias /cluebringer "$ENV{CLUEBRINGER_HTTPD_ROOT}/"\n${1}#' ${HTTPD_SSL_CONF}
 
     # Configure webui.
     if [ X"${BACKEND}" == X'OPENLDAP' -o X"${BACKEND}" == X'MYSQL' ]; then

iRedMail/functions/iredadmin.sh

 
     if [ X"${DISTRO}" == X'OPENBSD' ]; then
         # Create directory alias.
-        perl -pi -e 's#( *</VirtualHost>)#Alias /iredadmin/static "$ENV{IREDADMIN_HTTPD_ROOT_SYMBOL_LINK}/static"\n${1}#' ${HTTPD_SSL_CONF}
-        perl -pi -e 's#( *</VirtualHost>)#ScriptAlias /iredadmin "$ENV{IREDADMIN_HTTPD_ROOT_SYMBOL_LINK}/iredadmin.py"\n${1}#' ${HTTPD_SSL_CONF}
+        perl -pi -e 's#^( *</VirtualHost>)#Alias /iredadmin/static "$ENV{IREDADMIN_HTTPD_ROOT_SYMBOL_LINK}/static"\n${1}#' ${HTTPD_SSL_CONF}
+        perl -pi -e 's#^( *</VirtualHost>)#ScriptAlias /iredadmin "$ENV{IREDADMIN_HTTPD_ROOT_SYMBOL_LINK}/iredadmin.py"\n${1}#' ${HTTPD_SSL_CONF}
 
         # There's no wsgi module for Apache available on OpenBSD, so
         # iRedAdmin runs as CGI program.
 </Directory>
 EOF
     else
-        perl -pi -e 's#( *</VirtualHost>)#Alias /iredadmin/static "$ENV{IREDADMIN_HTTPD_ROOT_SYMBOL_LINK}/static/"\n${1}#' ${HTTPD_SSL_CONF}
-        perl -pi -e 's#( *</VirtualHost>)#WSGIScriptAlias /iredadmin "$ENV{IREDADMIN_HTTPD_ROOT_SYMBOL_LINK}/iredadmin.py/"\n${1}#' ${HTTPD_SSL_CONF}
+        perl -pi -e 's#^( *</VirtualHost>)#Alias /iredadmin/static "$ENV{IREDADMIN_HTTPD_ROOT_SYMBOL_LINK}/static/"\n${1}#' ${HTTPD_SSL_CONF}
+        perl -pi -e 's#^( *</VirtualHost>)#WSGIScriptAlias /iredadmin "$ENV{IREDADMIN_HTTPD_ROOT_SYMBOL_LINK}/iredadmin.py/"\n${1}#' ${HTTPD_SSL_CONF}
 
         # iRedAdmin runs as WSGI application with Apache + mod_wsgi
         cat > ${IREDADMIN_HTTPD_CONF} <<EOF

iRedMail/functions/optional_components.sh

         check_status_before_run fail2ban_config
 
     # Awstats.
-    [ X"${USE_AWSTATS}" == X"YES" -a X"${DISTRO}" != X'OPENBSD' ] && \
+    [ X"${USE_AWSTATS}" == X"YES" ] && \
         check_status_before_run awstats_config_basic && \
         check_status_before_run awstats_config_weblog && \
         check_status_before_run awstats_config_maillog && \

iRedMail/functions/packages.sh

     if [ X"${USE_RCM}" == X"YES" ]; then
         if [ X"${DISTRO}" == X'OPENBSD' ]; then
             ALL_PKGS="${ALL_PKGS} roundcubemail"
+
+            # MySQL driver for PHP, required by Roundcube.
+            [ X"${BACKEND}" == X'OPENLDAP' ] && ALL_PKGS="${ALL_PKGS} php-pdo_mysql"
+            [ X"${BACKEND}" == X'MYSQL' ] && ALL_PKGS="${ALL_PKGS} php-pdo_mysql"
+            [ X"${BACKEND}" == X'PGSQL' ] && ALL_PKGS="${ALL_PKGS} php-pdo_pgsql"
         fi
     fi
 
         elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
             ALL_PKGS="${ALL_PKGS} awstats"
         elif [ X"${DISTRO}" == X'OPENBSD' ]; then
-            # No port available.
-            :
+            ALL_PKGS="${ALL_PKGS} awstats"
+
+            [ X"${BACKEND}" == X'OPENLDAP' ] && ALL_PKGS="${ALL_PKGS} mod_auth_ldap"
+            [ X"${BACKEND}" == X'MYSQL' ] && ALL_PKGS="${ALL_PKGS} mod_auth_mysql"
+            [ X"${BACKEND}" == X'PGSQL' ] && ALL_PKGS="${ALL_PKGS} mod_auth_pgsql"
         fi
     fi
 

iRedMail/functions/packages_freebsd.sh

 OPTIONS_FILE_UNSET+=SCRAM
 EOF
 
-    # Perl 5.8. REQUIRED.
+    # Perl. REQUIRED.
     cat > /var/db/ports/perl/options <<EOF
 WITHOUT_DEBUGGING=true
 WITH_GDBM=true

iRedMail/functions/phpldapadmin.sh

 EOF
 
     # Make phpldapadmin can be accessed via HTTPS only.
-    perl -pi -e 's#( *</VirtualHost>)#Alias /phpldapadmin "$ENV{PLA_HTTPD_ROOT_SYMBOL_LINK}/"\nAlias /ldap "$ENV{PLA_HTTPD_ROOT_SYMBOL_LINK}/"\n${1}#' ${HTTPD_SSL_CONF}
+    perl -pi -e 's#^( *</VirtualHost>)#Alias /phpldapadmin "$ENV{PLA_HTTPD_ROOT_SYMBOL_LINK}/"\nAlias /ldap "$ENV{PLA_HTTPD_ROOT_SYMBOL_LINK}/"\n${1}#' ${HTTPD_SSL_CONF}
 
     cat >> ${TIP_FILE} <<EOF
 phpLDAPadmin:

iRedMail/functions/phpmyadmin.sh

     fi
 
     # Make phpMyAdmin can be accessed via HTTPS only.
-    perl -pi -e 's#( *</VirtualHost>)#Alias /phpmyadmin "$ENV{PHPMYADMIN_HTTPD_ROOT_SYMBOL_LINK}/"\n${1}#' ${HTTPD_SSL_CONF}
+    perl -pi -e 's#^( *</VirtualHost>)#Alias /phpmyadmin "$ENV{PHPMYADMIN_HTTPD_ROOT_SYMBOL_LINK}/"\n${1}#' ${HTTPD_SSL_CONF}
 
     ECHO_DEBUG "Config phpMyAdmin: ${PHPMYADMIN_CONFIG_FILE}."
     cd ${PHPMYADMIN_HTTPD_ROOT} && cp config.sample.inc.php ${PHPMYADMIN_CONFIG_FILE}

iRedMail/functions/phppgadmin.sh

 EOF
 
     # Make phpPgAdmin can be accessed via HTTPS only.
-    perl -pi -e 's#( *</VirtualHost>)#Alias /phppgadmin "$ENV{PHPPGADMIN_HTTPD_ROOT_SYMBOL_LINK}/"\n${1}#' ${HTTPD_SSL_CONF}
+    perl -pi -e 's#^( *</VirtualHost>)#Alias /phppgadmin "$ENV{PHPPGADMIN_HTTPD_ROOT_SYMBOL_LINK}/"\n${1}#' ${HTTPD_SSL_CONF}
 
     ECHO_DEBUG "Config phpPgAdmin: ${PHPPGADMIN_CONFIG_FILE}."
     cd ${PHPPGADMIN_HTTPD_ROOT} && cp config.inc.php-dist ${PHPPGADMIN_CONFIG_FILE} &>/dev/null

iRedMail/functions/roundcubemail.sh

     fi
 
     # Make Roundcube can be accessed via HTTPS.
-    perl -pi -e 's#( *</VirtualHost>)#Alias /mail "$ENV{RCM_HTTPD_ROOT_SYMBOL_LINK}/"\n${1}#' ${HTTPD_SSL_CONF}
+    perl -pi -e 's#^( *</VirtualHost>)#Alias /mail "$ENV{RCM_HTTPD_ROOT_SYMBOL_LINK}/"\n${1}#' ${HTTPD_SSL_CONF}
 
     # Redirect home page to webmail by default
     backup_file ${HTTPD_DOCUMENTROOT}/index.html
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.