Comment 6 for bug 150649

Revision history for this message
Mrts (mrts) wrote :

To get mysql authentication working in Gutsy, you have to manually compile mod_auth_mysql:

1. wget http://heanet.dl.sourceforge.net/sourceforge/modauthmysql/mod_auth_mysql-3.0.0.tar.gz
2. wget http://www.bleb.org/software/mod_auth_mysql-3.0.0-apache-2.2.3.patch
3. tar zxf mod_auth_mysql-3.0.0.tar.gz
4. apt-get install apache2-prefork-dev libmysqlclient15-dev; apt-get --purge remove libapache2-mod-auth-mysql
5. cd mod_auth_mysql-3.0.0
6. patch < ../mod_auth_mysql-3.0.0-apache-2.2.3.patch
7. sed -i 's|#include <mysql.h>|#include <mysql/mysql.h>|' mod_auth_mysql.c
8. apxs2 -c -lmysqlclient -lm -lz mod_auth_mysql.c
9. apxs2 -i mod_auth_mysql.la
10. echo 'LoadModule mysql_auth_module /usr/lib/apache2/modules/mod_auth_mysql.so' > /etc/apache2/mods-available/auth_mysql.load
11. a2enmod auth_mysql

Configure it as follows (adapt to your environment):

        <Location /mysqlauth>
            AuthName "test"
            AuthType Basic
            AuthUserFile /dev/null
            AuthBasicAuthoritative Off

            AuthMySQLEnable On
            AuthMySQLAuthoritative On
            AuthMySQLDB apache_auth_test
            AuthMySQLUser authtestuser
            AuthMySQLPassword something
            AuthMySQLUserTable auth
            AuthMySQLNameField username
            AuthMySQLPasswordField passwd
            require valid-user
        </Location>

Hope this helps someone.