?
Solved

Using mod auth mysql - syntax of htaccess

Posted on 2014-11-16
4
Medium Priority
?
397 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 51

Accepted Solution

by:
Steve Bink earned 2000 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 51

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

Optimum High-Definition Video Viewing and Control

The ATEN VM0404HA 4x4 4K HDMI Matrix Switch supports 4K resolutions of UHD (3840 x 2160) and DCI (4096 x 2160) with refresh rates of 30 Hz (4:4:4) and 60 Hz (4:2:0). It is ideal for applications where the routing of 4K digital signals is required.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

777 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