Auth-mysql unter Debian/etch

Aus Bennys Wiki
Wechseln zu: Navigation, Suche

you can now enjoy my recycle bin section with the same user account of this blog! the user accounts authentication of drupal and apache is now shared within MySQL, by using mod_auth_mysqll!

by using this method:

1. you can create your user account as you like 2. i will have the right to keep trace who are using my service 3. account handling are all integrated with drupal, so i can administrate all of this by using drupal interface!

finally find the solution for mod_auth_mysql under apache2.2 and Debian testing: compile from source. here is a quick howto:

apt-get install apache2-prefork-dev libmysqlclient15-dev

2. get this two files:

if the site does not work here are the mirrored files
tar xzf mod_auth_mysql-3.0.0.tar.gz
mv apache22.diff mod_auth_mysql-3.0.0/
cd mod_auth_mysql-3.0.0
patch -p1 <apache22.diff
apxs2 -c -L/usr/lib/mysql -I/usr/include/mysql -lmysqlclient -lm -lz mod_auth_mysql.c
apxs2 -i
echo "LoadModule mysql_auth_module /usr/lib/apache2/modules/" > /etc/apache2/mods-available/auth_mysql.load
a2enmod auth_mysql

7. edit .htaccess according to, here is my example, which integrated with drupal authentication system:

      AuthType Basic
      AuthBasicAuthoritative Off
      AuthName "CHAMGEME"
      AuthGroupFile /dev/null
      AuthUserFile /dev/null
      AuthMySQLEnable On
      AuthMySQLHost localhost
      AuthMySQLUser CHAMGEME
      AuthMySQLPassword CHAMGEME
      AuthMySQLUserTable users
      AuthMySQLUserCondition "users.status = 1"
      AuthMySQLNameField name
      AuthMySQLPasswordField pass
      AuthMySQLNoPasswd Off
      AuthMySQLPwEncryption md5
      AuthMySQLAuthoritative On
      require valid-user

20070317: some bug fix, so check if user have login once (which means they pass the checking and successfully login, their account is not valid): AuthMySQLUserCondition "users.status = 1 AND users.access <> 0"

Die Originalseite ist hier zu finden - aber recht laaaangsaaaam