View Single Post

  #2 (permalink)  
Old 06-05-2004
Kieran Simkin
 
Posts: n/a
Default Re: *sigh* mod_auth_mysql

"fixx" <fixx@nospam.fixx.co.za> wrote in message
news:c9qec5$gkt$1@ctb-nnrp2.saix.net...
> Hello Everyone
>
> I have been struggeling with mod_auth_mysql for 4 days now :-/
> I have seen so many examples on the internet, but none that actually help
> me.
>
> I am running FreeBSD 4.10 with apache1.3
> This is what I got in my httpd.conf file:
> --------------------------------------
>
> Auth_MySQL_Info localhost root myp4ssw0rd
> <Directory /home/httpd/html/somedomain.com/design>
> AllowOverRide All
> Order allow,deny
> Allow from all
> </Directory>
>
> If I manually connect to the mysql from console like this:
> mysql -h localhost -u root -p <mydatabase>
> It authenticates using myp4ssw0rd as the password
>
> Here is what I got in .htaccess of the design/ directory:
> -------------------------------------------------------
>
> AuthType Basic
> AuthName "Enter your Username and Password"
> Auth_MySQL_DB <a_database>
> Auth_MySQL_Password_Table <the_correct_table>
> Auth_MySQL_Username_Field username
> Auth_MySQL_Password_Field password
> Auth_MySQL_Empty_Passwords Off
> Auth_MySQL_Encrypted_Passwords off
> Require valid-user
>
> The password and username is in plain text, no mysql_crypt() or md5() or
> anything is used.
>
> When I open the URL, it actually pops up and asking me for the username

and
> password, but then after giving it, I get the following apache error
> from the domain.com error log:
> -------------------------------
>
> [Fri Jun 4 19:53:48 2004] [error] (49)Can't assign requested address:

MySQL
> auth: connect failed: Can't connect to MySQL server on 'localhost' (49)


This looks like the kind of error you'd get if apache were trying to connect
to mysql on a socket that doesn't exist. MySQL usually listens on
/tmp/mysql.sock, check this file exists and that it's a socket. Then see
where mod_auth_mysql is looking for a socket, it may be looking somewhere
else. I must admit I've never used mod_auth_mysql, but this is a pretty
general libmysqlclient error message you're getting.

Failing all else, you could try resorting to using tcp sockets and see if
that resolves your problem. (hint, try using your real address rather than
localhost for the server name field in mod_auth_mysql - and check mysql's
actually listening on a tcp socket).

Let me know how you get on and I'll see if I can help further.

>
> I am using unix sockets for the mysql, and not tcp connections, I also

have
> an entry in /etc/hosts for localhost
> No One can help me fix it (apparently), you guys are my last hope </cry>
>
> Thanks in advance.
>
>
> fixx
>
> -- In a world with no boundaries, Who Needs Gates?
>
>
>