August 2006

More Mod_Auth_MySQL Tips

by damonp on August 21, 2006

in SysAdmin

Adding mod_auth_mysql (v3.0) to an Apache server already using basic authentication breaks the basic authentication. Mod_auth_mysql seems to supersede any other authentication schemas. A simple workaround I found was to explictly turn off Mod_auth_mysql using a .htaccess for those directories that will still use basic authentication.

AuthMySQLEnable Off

Popularity: 1%

{ 0 comments }

Mod_Auth_MySQL and ErrorDocument with Apache

by damonp on August 18, 2006

in SysAdmin

Mod_Auth_MySQL is a useful Apache module for allowing HTTPD Authentication against a MySQL database. This makes it very convenient to code a simple authentication process in PHP.

I beat my head against this problem for an hour before I found the solution…

When using an ErrorDocument directive in a .htaccess file similar to the form:

ErrorDocument 401 /error.php?err=401

Apache, ErrorDocument 401 and Mod_Auth_MySQL don’t seem to play nice together. Tested on several different servers, Apache kept throwing a 401 Unauthorized error back no matter how I configured it.

Turning off the ErrorDocument 401 directive for the protected directory with the following directive seems to work around the problem.

ErrorDocument 401 -

Not a perfect solution as 401′s in the protected directory will either be blank or the Apache default.

Popularity: 1%

{ 0 comments }

Quick and Dirty MySQL Backup

4 August 2006

This is great for a quick backup of all databases before performing maintenance or check/repair. mysqldump –all-databases -p | gzip > db_dump-YYYYMMDD.gz Replace YYYYMMDD with Year, Month and Day.

Read the full article →