I've been struggling with this in a brand new 8.10 server myself that I just setup yesterday. Not sure how or why, but i got this magic incantation to work (do note however, I'm storing the passwords in plaintext in mySQL):
<Directory /home/dae51d/public_html/examples/crimson>
AuthName "CRiMson -- use: test/test1234"
AuthType Basic
require valid-user
AuthUserFile /dev/null
AuthBasicAuthoritative Off
# http://www.daevid.com/server-info#mod_auth_mysql.c
Auth_MYSQL On
Auth_MySQL_Host localhost
Auth_MySQL_User crimson_user
Auth_MySQL_Password crimson_password
Auth_MySQL_DB crimson_database
Auth_MySQL_Authoritative On
Auth_MySQL_Password_Table rep_table
Auth_MySQL_Encryption_Types Plaintext MySQL
Auth_MySQL_Encrypted_Passwords Off
Auth_MySQL_Empty_Passwords Off
Auth_MySQL_Username_Field rep_login
Auth_MySQL_Password_Field rep_password
</Directory>
But what I don't understand is when I do this one:
<Directory /home/reviewit/public_html/admin>
Options All +Includes
AllowOverride None
AuthName "SYMCELL Administration"
AuthType Basic
require valid-user
AuthUserFile /dev/null
AuthBasicAuthoritative Off
# http://www.daevid.com/server-info#mod_auth_mysql.c
Auth_MYSQL On
Auth_MySQL_Host localhost
Auth_MySQL_User reviewit_user
Auth_MySQL_Password reviewit_pass
Auth_MySQL_DB reviewit_db
Auth_MySQL_Authoritative On
Auth_MySQL_Password_Table users
Auth_MySQL_Encryption_Types SHA1Sum
Auth_MySQL_Encrypted_Passwords On
Auth_MySQL_Empty_Passwords Off
Auth_MySQL_Username_Field username
Auth_MySQL_Password_Field password
# Auth_MySQL_Where " type = 'Admin' AND enabled = 1 "
Auth_MySQL_Where " enabled = 1 "
</Directory>
Everything works except for the Auth_MySQL_Where part which says:
[Tue Feb 10 18:26:34 2009] [error] Query call failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'type = "Admin" AND enabled = 1' at line 1 (1064)
But removing the " type = 'Admin'" then it works. I've tried reversing the quotes. without any " on the ends. \'Admin\' and I can't figure out the magic incantation.
Also, my mod_auth_mysql.c shows Auth_MySQL_Where as the directive, but this page (http://modauthmysql.sourceforge.net/CONFIGURE) shows AuthMySQLUserCondition and NO Auth_MySQL_Where...
Come on man! it's bad enough the directives keep changing slightly with underscores and such with each version but now you don't even have the same directive names. Is this project dead? it's v3.0.0 was on 2005-6-22 -- that's 3.5 YEARS ago! What pisses me off more is that this USED to work with an older version of mod_auth_mysql I had on my Gentoo box which was v3.0.0. And there is no current documentation that I've found for the current apt-get version...
# dpkg -s libapache2-mod-auth-mysql
Package: libapache2-mod-auth-mysql
Status: install ok installed
Priority: optional
Section: web
Installed-Size: 108
Maintainer: Ubuntu Core Developers <email address hidden>
Architecture: i386
Source: mod-auth-mysql
Version: 4.3.9-9
Depends: libc6 (>= 2.4), libmysqlclient15off (>= 5.0.27-1), apache2.2-common (>= 2.2.3-3)
Description: Apache 2 module for MySQL authentication
A module for the Apache 2 web server which enables HTTP authentication
against information stored in a MySQL database.
Original-Maintainer: Joey Schulze <email address hidden>
I've been struggling with this in a brand new 8.10 server myself that I just setup yesterday. Not sure how or why, but i got this magic incantation to work (do note however, I'm storing the passwords in plaintext in mySQL):
<Directory /home/dae51d/ public_ html/examples/ crimson> Authoritative Off www.daevid. com/server- info#mod_ auth_mysql. c MySQL_Host localhost MySQL_User crimson_user MySQL_Password crimson_password MySQL_Authorita tive On
AuthName "CRiMson -- use: test/test1234"
AuthType Basic
require valid-user
AuthUserFile /dev/null
AuthBasic
# http://
Auth_MYSQL On
Auth_
Auth_
Auth_
Auth_MySQL_DB crimson_database
Auth_
Auth_ MySQL_Password_ Table rep_table MySQL_Encryptio n_Types Plaintext MySQL MySQL_Encrypted _Passwords Off MySQL_Empty_ Passwords Off MySQL_Username_ Field rep_login MySQL_Password_ Field rep_password
Auth_
Auth_
Auth_
Auth_
Auth_
</Directory>
But what I don't understand is when I do this one:
<Directory /home/reviewit/ public_ html/admin>
Options All +Includes
AllowOverride None
AuthName "SYMCELL Administration" Authoritative Off www.daevid. com/server- info#mod_ auth_mysql. c MySQL_Host localhost MySQL_User reviewit_user MySQL_Password reviewit_pass MySQL_Authorita tive On
AuthType Basic
require valid-user
AuthUserFile /dev/null
AuthBasic
# http://
Auth_MYSQL On
Auth_
Auth_
Auth_
Auth_MySQL_DB reviewit_db
Auth_
Auth_ MySQL_Password_ Table users MySQL_Encryptio n_Types SHA1Sum MySQL_Encrypted _Passwords On MySQL_Empty_ Passwords Off MySQL_Username_ Field username MySQL_Password_ Field password MySQL_Where " enabled = 1 "
Auth_
Auth_
Auth_
Auth_
Auth_
# Auth_MySQL_Where " type = 'Admin' AND enabled = 1 "
Auth_
</Directory>
Everything works except for the Auth_MySQL_Where part which says:
[Tue Feb 10 18:26:34 2009] [error] Query call failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'type = "Admin" AND enabled = 1' at line 1 (1064)
But removing the " type = 'Admin'" then it works. I've tried reversing the quotes. without any " on the ends. \'Admin\' and I can't figure out the magic incantation.
Also, my mod_auth_mysql.c shows Auth_MySQL_Where as the directive, but this page (http:// modauthmysql. sourceforge. net/CONFIGURE) shows AuthMySQLUserCo ndition and NO Auth_MySQL_Where...
Come on man! it's bad enough the directives keep changing slightly with underscores and such with each version but now you don't even have the same directive names. Is this project dead? it's v3.0.0 was on 2005-6-22 -- that's 3.5 YEARS ago! What pisses me off more is that this USED to work with an older version of mod_auth_mysql I had on my Gentoo box which was v3.0.0. And there is no current documentation that I've found for the current apt-get version...
# dpkg -s libapache2- mod-auth- mysql mod-auth- mysql Maintainer: Joey Schulze <email address hidden>
Package: libapache2-
Status: install ok installed
Priority: optional
Section: web
Installed-Size: 108
Maintainer: Ubuntu Core Developers <email address hidden>
Architecture: i386
Source: mod-auth-mysql
Version: 4.3.9-9
Depends: libc6 (>= 2.4), libmysqlclient15off (>= 5.0.27-1), apache2.2-common (>= 2.2.3-3)
Description: Apache 2 module for MySQL authentication
A module for the Apache 2 web server which enables HTTP authentication
against information stored in a MySQL database.
Original-