This is a discussion on *sigh* mod_auth_mysql within the Apache Web Server forums, part of the Web Server and Related Forums category; Hello Everyone I have been struggeling with mod_auth_mysql for 4 days now :-/ I have seen so many examples on the ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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) 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? |
|
|||
|
"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? > > > |
|
|||
|
Hi Kieran
Thanks for the reply After the first post, i also came to the conclusion that the mod_auth_mysql is trying to connect to the socket, but I have been struggeling to get the mysqld running on a tcp socket, i did start it with --port=3306 and deleted the line that said --socket=/tmp/mysql.sock from the rc script But still it created /tmp/mysql.sock. So I recompiled the mysql (version 4 by the way) with the --tcp-port=3306 flag, but to no avail :-/ Here is my rc script fot the mysqld: (Also netstat -a does not show mysql listening on a tcp socket, but it show the unix socket) DB_DIR=/var/db/mysql PIDFILE=${DB_DIR}/`/bin/hostname -s`.pid case "$1" in start) if [ -x /usr/local/bin/mysqld_safe ]; then /usr/bin/limits -U mysql \ /usr/local/bin/mysqld_safe --user=mysql --datadir=${DB_DIR} --pid-file=${PIDFILE} > /dev/null & echo -n ' mysqld' fi ;; stop) if [ -f ${PIDFILE} ]; then /bin/kill `cat ${PIDFILE}` > /dev/null 2>&1 && echo -n ' mysqld' else echo "mysql-server isn't running" fi ;; *) echo "" echo "Usage: `basename $0` { start | stop }" echo "" exit 64 ;; esac Thanks |