1

Topic: iRedmail breaks apache 2.4 on starting

==== Required information ====
- iRedMail version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Linux/BSD distribution name and version:
- Related log if you're reporting an issue:
====

Hello, I used to have iRedMail on my ubuntu 12.04 installation but I upgraded php and apache to apache 2.4 but now its broke and I think its because of iRedMail. The error I am receiving is

AH00526: Syntax error on line 25 of /etc/apache2/conf.d/awstats.conf:
Invalid command 'AuthMYSQL', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.

when I try to restart apache.

Is there any workaround to solve this problem?

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: iRedmail breaks apache 2.4 on starting

You can fix it by disabling Apache module: auth_mysql. It's not compatible with Apache-2.4, so we have to disable it.

NOTE: auth_mysql is installed and enabled by iRedMail-0.8.7 by default, so web access to Awstats and Cluebringer webui have the same issue, you have to use Apache module 'authn_dbd' instead.

*) Install required package:

# apt-get install libaprutil1-dbd-mysql

*) Backup old Apache config files:

# cd /etc/apache2/conf-available/
# cp awstats.conf awstats.conf.bak
# cp cluebringer.conf cluebringer.conf.bak

*) Replace awstats.conf and cluebringer.conf with attached sample config files. NOTE: Please replace vmail password by the real one.

*) Enable both config files and required Apache authentication module:

# a2enconf awstats
# a2enconf cluebringer
# a2enmod authn_dbd

*) Comment out (all) below settings in /etc/apache2/apache.conf:

Auth_MySQL_Info
Auth_MySQL_General_DB

*) Restart Apache service:

# service apache2 restart

NOTE: This issue will be fixed in next release of iRedMail.

*) Sample awstats.conf:

DBDriver mysql
# Important note: use 'pass=' for MySQL, 'password=' for PostgreSQL.
DBDParams "host=127.0.0.1 port=3306 dbname=vmail user=vmail pass=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

<Directory /usr/lib/cgi-bin>
    DirectoryIndex awstats.pl
    Options ExecCGI

    AuthType Basic
    AuthName "Authentication required"
    AuthBasicProvider dbd
    AuthDBDUserPWQuery "SELECT password FROM mailbox WHERE username = %s AND isglobaladmin=1 LIMIT 1"

    Require valid-user
</Directory>

*) Sample cluebringer.conf:

DBDriver mysql
# Important note: use 'pass=' for MySQL, 'password=' for PostgreSQL.
DBDParams "host=127.0.0.1 port=3306 dbname=vmail user=vmail pass=xxxxxxxxxxxxxxxxxxxxxxxx"

<Directory /usr/share/postfix-cluebringer-webui/webui>
    DirectoryIndex index.php

    AuthType Basic
    AuthName "Authentication required"
    AuthBasicProvider dbd
    AuthDBDUserPWQuery "SELECT password FROM mailbox WHERE username = %s AND isglobaladmin=1 LIMIT 1"

    Require valid-user
</Directory>