Solved

Using mod auth mysql - syntax of htaccess

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

757 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now