LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-18-2006, 04:40 AM   #1
johnewing
Member
 
Registered: Jul 2003
Location: Scotland
Posts: 34

Rep: Reputation: 16
Apache mod_auth_mysql problem


Hi I am having a problem with using mod_auth_mysql with apache 2.2 on RHEL4.

I have managed to get authentication working but whenever anyone accesses the areas of the site which are protected the error log file is filled with

[error] Internal error: pcfg_openfile() called with NULL filename


The appropriate bits of the httpd.conf look like

#Stuff for Munit monitoring

ScriptAlias /monitoring/cgi "/usr/local/munin/var/www/cgi/"
Alias /monitoring "/usr/local/munin/var/www/"

<Directory /usr/local/munin/var/www/>
#mod_auth_mysql stuff

AuthName "xxxxx"
AuthType Basic
AuthBasicAuthoritative Off
AuthMySQLHost localhost
AuthMySQLDB http_auth
AuthMySQLPasswordField user_passwd
AuthMySQLUserTable http_auth_users
AuthMySqlUser xxxx
AuthMySqlPassword xxxx
AuthMySQLEnable On
AuthMySQLPwEncryption MD5
AuthMySQLAuthoritative On
require valid-user

</Directory>

<Directory /usr/local/munin/var/www/cgi>
AllowOverride none
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all



</Directory>


Anyone have any ideas why its giving this error message

Thanks

J.

Last edited by johnewing; 10-18-2006 at 08:50 AM.
 
Old 10-27-2006, 04:51 AM   #2
johnewing
Member
 
Registered: Jul 2003
Location: Scotland
Posts: 34

Original Poster
Rep: Reputation: 16
For anyone who has the same problem the fix is to add the following line to the <directory> directives


AuthUserFile /dev/null

The error messages are apparently caused by apache 2.2.2 expecting a users file even if the auth method doesn't use one. And also probably by the fact that you need to use an unofficial patch to get mod_auth_mysql to complile.

J.
 
Old 02-27-2007, 01:32 PM   #3
blahJake
LQ Newbie
 
Registered: Aug 2003
Location: Atlanta, GA or DeLand, FL
Distribution: Fedora Core 6, various for work
Posts: 16

Rep: Reputation: 0
Thanks John. Cleared it right up for me.
 
Old 05-23-2007, 09:26 PM   #4
koncept
LQ Newbie
 
Registered: Sep 2005
Posts: 13

Rep: Reputation: 0
i don't mean to bump this, but i've been struggling with this all night and this fixed it so i gotta say thanks!

edit: all is not well...
it keeps saying user not found. did either of you experience that? im on apache 2.2 and mod_auth_mysql 3.0

Last edited by koncept; 05-23-2007 at 09:55 PM.
 
Old 05-24-2007, 06:23 AM   #5
johnewing
Member
 
Registered: Jul 2003
Location: Scotland
Posts: 34

Original Poster
Rep: Reputation: 16
Could you post the exact error you are getting?

I can't tell from the information you provided whether it's an apache user error or a mysql user error.

Cheers

J.
 
Old 05-24-2007, 06:25 AM   #6
koncept
LQ Newbie
 
Registered: Sep 2005
Posts: 13

Rep: Reputation: 0
i am getting a message saying user not found in the apache error log. my config matches what is above
 
Old 05-24-2007, 07:00 AM   #7
johnewing
Member
 
Registered: Jul 2003
Location: Scotland
Posts: 34

Original Poster
Rep: Reputation: 16
I need the exact text of the error message.

Have you tried logging in to mysql from the command line with the user that you have specified as authmysqluser ?

e.g.

mysql -u authusername -p authuserpass

where authusername and authuserpass are what you specified in the
apache configuration file.

J.
 
Old 05-24-2007, 02:04 PM   #8
Techs77
LQ Newbie
 
Registered: May 2007
Posts: 2

Rep: Reputation: 0
Question I think I have the same problem

This is the error I'm getting when I try to view our website, thearkinc.com:


Unable to connect to database server

This either means that the username and password information in your settings.php file is incorrect or we can't contact the MySQL database server. This could mean your hosting provider's database server is down.

The MySQL error was: Access denied for user: 'mysqluser@localhost' (Using password: YES).

Currently, the username is arksqluser and the database server is localhost.

* Are you sure you have the correct username and password?
* Are you sure that you have typed the correct hostname?
* Are you sure that the database server is running?

I've discovered it's only the parts of the site that uses the mysql db that doesn't work, so I tried to login on the command line using:
mysql -u myauthuser -p myauthpasswd as root
and I get:
ERROR 1045: Access denied for user: 'myauthuser@myhost' (Using password: YES)
I know I'm using the correct username and password. I've restarted the server to no avail and restarted the mysqld service with no errors. Any ideas would be greatly appreciated. Thanks in advance for any help.
The server is running RH w/ Fedora Core 2

Last edited by Techs77; 05-24-2007 at 02:07 PM.
 
Old 05-24-2007, 02:19 PM   #9
Techs77
LQ Newbie
 
Registered: May 2007
Posts: 2

Rep: Reputation: 0
Thumbs up Got it

So, our server uses a program called Plesk. For some reason it seems to overwrite files at random times. Can't figure that out yet, but I can access Plesk Control Panel online. The fix was to turn the domain controler back on and somehow this fixed the mysql login problem. Yes, I am new to this. Thanks.
 
  


Reply

Tags
error, mysql, user



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apxs -i mod_auth_mysql.so question cz1179 Linux - General 1 01-23-2005 09:01 AM
loading mod_auth_mysql tommytomato Linux - General 0 09-07-2004 07:48 AM
apache module mod_auth_mysql question SuSE_fan Linux - Software 0 06-01-2004 05:51 AM
Apache won't start, problem with libcppu and mod_auth_mysql.so Null537 Linux - Software 3 05-29-2004 09:32 AM
Unable to start apache because of mod_auth_mysql error krumholz Linux - General 3 07-17-2003 11:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration