Webtatic.com

Just another technical blog

mod_auth_mysql digest authentication patch

Posted 31st May 2009 by Andy | 2 Comments

Recently, I wrote a mod_perl module for using a database backend for basic and digest authentication in Apache, however I found it to be much slower than mod_auth_mysql. This would be due to using mod_perl and DBI. So I have written a patch for mod_auth_mysql which performs the same, which means its as fast.

The main reason why I chose to do this rather than use Webtatic::AuthDBI is because subversion checkouts were taking twice as long. A mod_perl authentication provider, even without performing authentication (just returning OK for any login details) seems to be the speed of the whole mod_auth_mysql without even establishing a mysql connection.

This patch seems to perform just as well as mod_auth_mysql.

Check it out here: /projects/mod_auth_mysql-auth/

Related Posts

2 Responses to “mod_auth_mysql digest authentication patch”

  1. Nice work. Maybe you should rename it to mod_auth_mysql_digest instead of mod_auth_mysql-auth. If I was searching for this I would probably look for mod auth mysql digest or something like that….

  2. Andy says:

    Yep, I had originally called it that but thought it would be ignoring the fact it also has changes for basic authentication as well.

    The “auth” part I added was to mean it uses the mod_auth hooks rather than just the apache ap_hook_check_user_id.

    For the most part though, the basic changes would go unnoticed, the only real gain is that you can reorder multiple providers in the apache conf, so e.g AuthBasicProvider file mysql.

    I’ve modified my blog post title to put the digest closer to the mod_auth_mysql, so hopefully that’ll bump my post from 3rd on google to 1st for mod_auth_mysql digest.

Leave a Reply