Solved

Using mod auth mysql - syntax of htaccess

Posted on 2014-11-16
4
353 Views
Last Modified: 2014-11-17
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

0
Comment
Question by:projects
  • 2
  • 2
4 Comments
 
LVL 50

Accepted Solution

by:
Steve Bink earned 500 total points
ID: 40447503
That is because "AuthMySQL" is not a defined directive...it should probably by AuthMySQLEnable.  Check here for the proper directive syntax.

 Also note the lack of underscores in the docs...virtually every one of your mod_auth_mysql directives will not be recognized.

How did you generate that .htaccess file?
0
 

Author Comment

by:projects
ID: 40448031
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.
0
 
LVL 50

Expert Comment

by:Steve Bink
ID: 40448465
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
0
 

Author Comment

by:projects
ID: 40448472
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.
0

Featured Post

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question