Link to home
Start Free TrialLog in
Avatar of projects
projects

asked on

Using mod auth mysql - syntax of htaccess

I keep getting the following error when I try to enable htaccess for mod auth mysql.

.htaccess: Invalid command 'AuthMySQL', perhaps misspelled or defined by a module not included in the server configuration

The module is definitely installed and ready to be used. All I can think of is that there is a mix up in using the underscore in some of the variables below. Looking on the net leads to nothing specific so time to ask here.

I also have the db table populated with the access details so why is this not working?

AuthBasicAuthoritative Off
AuthUserFile /dev/null
AuthMySQL On
AuthName "Authentication required"
AuthType Basic
Auth_MySQL_Host localhost
Auth_MySQL_User someuser
Auth_MySQL_Password somepass
AuthMySQL_DB somedb
AuthMySQL_Password_Table htaccess
Auth_MySQL_Username_Field username
Auth_MySQL_Password_Field password
Auth_MySQL_Empty_Passwords Off
Auth_MySQL_Encryption_Types PHP_MD5
Auth_MySQL_Authoritative On
require valid-user

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Steve Bink
Steve Bink
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of projects
projects

ASKER

This doesn't seem to be the problem because I've edited to remove the dashes and that still doesn't work. Searching on the net shows many examples, all using dashes and none. Very confusing.
First, if my suggestion did not resolve the issue, it should not be selected as a valid solution.  Use the "Request Attention" link and ask to have it re-opened.  With the question closed, it will not receive any further input from other experts.

When you edited the .htaccess file to remove the underscores, in what way did it still not work?  Did you receive an error message?  What were the exact changes you made?

To assist you further, please provide the following information:
Version of Apache
Version and package name of mod_auth_mysql
Version of MySQL server
CREATE TABLE statement for table somedb.htaccess
A valid, sample row from somedb.htaccess
The current .htaccess revision
Any error messages you receive when testing
I selected the solution because the answer was syntax and because I went in another direction since I wasn't able to find a quick solution.

My solution will be to not use mysql because that would cause too many additional reads for no good reason in my application.