Solved

Using mod auth mysql - syntax of htaccess

Posted on 2014-11-16
4
364 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

739 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