Commits

Zhang Huangbin committed f516499

Fix incorrect 'Require' directive for Apache 2.4: Require valid-user -> Require all granted.

  • Participants
  • Parent commits 0e7a797

Comments (0)

Files changed (5)

iRedMail/conf/apache_php

 
 export HTTPD_PORT='80'
 export HTTPD_RC_SCRIPT_NAME='apache2'
+export APACHE_VERSION='2.2'
 
 if [ X"${DISTRO}" == X"RHEL" ]; then
     export HTTPD_RC_SCRIPT_NAME='httpd'
         export HTTPD_SSL_CONF="${HTTPD_CONF_ROOT}/sites-available/default-ssl"
         export HTTPD_MOD_CONF_SECURITY="${HTTPD_CONF_DIR}/security"
     else
+        # For Ubuntu 14.04 and later
+        export APACHE_VERSION='2.4'
+
         export HTTPD_CONF_DIR="${HTTPD_CONF_ROOT}/conf-available"
         export HTTPD_SSL_CONF="${HTTPD_CONF_ROOT}/sites-available/default-ssl.conf"
         export HTTPD_MOD_CONF_SECURITY="${HTTPD_CONF_DIR}/security.conf"
 
 export HTTPD_CGIBIN_DIR="${HTTPD_SERVERROOT}/cgi-bin"
 
+if [ X"${APACHE_VERSION}" == X'2.4' ]; then
+    HTTPD_DIRECTIVE_REQUIRE='Require all granted'
+else
+    HTTPD_DIRECTIVE_REQUIRE='Require valid-user'
+fi
+
+# PHP
+export PHP_DISABLED_FUNCTIONS='show_source,system,shell_exec,passthru,exec,phpinfo,proc_open'
+
 # PHP connection type: mysql, mysqli (recommended).
 export PHP_CONN_TYPE='mysqli'
-
-export PHP_DISABLED_FUNCTIONS='show_source,system,shell_exec,passthru,exec,phpinfo,proc_open'
-
 [ X"${BACKEND}" == X"PGSQL" ] && export PHP_CONN_TYPE='pgsql'

iRedMail/conf/awstats

     # This path will be changed in 'functions/awstats.sh'.
     export AWSTATS_CGI_DIR="/usr/lib/cgi-bin"
 
-    # Load awstats as last Apache config file
-    export AWSTATS_HTTPD_CONF="${HTTPD_CONF_DIR}/zawstats.conf"
-
 elif [ X"${DISTRO}" == X"FREEBSD" ]; then
     export AWSTATS_HTTPD_ROOT="${HTTPD_SERVERROOT}/awstats"
     export AWSTATS_ICON_DIR="${AWSTATS_HTTPD_ROOT}/icon"

iRedMail/conf/cluebringer

     export CLUEBRINGER_PID_FILE='/var/run/cluebringer/cbpolicyd.pid'
     export CLUEBRINGER_HTTPD_ROOT='/usr/share/postfix-cluebringer-webui/webui'
 
-    export CLUEBRINGER_HTTPD_CONF="${HTTPD_CONF_DIR}/zcluebringer.conf"
-
 elif [ X"${DISTRO}" == X"FREEBSD" ]; then
     export CLUEBRINGER_USER='policyd'
     export CLUEBRINGER_GROUP='policyd'

iRedMail/functions/awstats.sh

 
     # Close <Directory> container.
     cat >> ${AWSTATS_HTTPD_CONF} <<EOF
-
-    Require valid-user
+    ${HTTPD_DIRECTIVE_REQUIRE}
 </Directory>
 EOF
 
 
     if [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
         a2enmod cgi &>/dev/null
-        a2enconf zawstats &>/dev/null
+        a2enconf awstats &>/dev/null
     fi
 
     cat >> ${TIP_FILE} <<EOF

iRedMail/functions/cluebringer.sh

     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
 
         # Close <Directory> container.
         cat >> ${CLUEBRINGER_HTTPD_CONF} <<EOF
-
-    Require valid-user
+    ${HTTPD_DIRECTIVE_REQUIRE}
 </Directory>
 EOF