﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
6612	Apache auth recipe works but gives error in error_log in Apache 2.2	trbs	nobody	"The recipe on the documentation page [http://www.djangoproject.com/documentation/apache_auth/ Authenticating against Django’s user database from Apache]: 

[Sat Feb 16 00:40:01 2008] [error] [client localhost] (9)Bad file descriptor: Could not open password file: (null), referer: !https://localhost/media/adminmedia/css/global.css

The solution for me was to include the '''!AuthUserFile /dev/null''' directive to the Location tag:

{{{
<Location /example/>
    AuthType Basic
    AuthName ""example.com""
    AuthBasicAuthoritative Off
    AuthUserFile /dev/null
    Require valid-user

    SetEnv DJANGO_SETTINGS_MODULE mysite.settings
    PythonAuthenHandler django.contrib.auth.handlers.modpython
</Location>
}}}

Although the title of this ticket says Apache 2.2, i have not tested this on other Apache versions.

Without the '''!AuthUserFile /dev/null''' directive everything works fine however apache prints the error log message for each request that uses the authentication handler. Which grows the error_log with inappropriate messages, so i think it's useful to add this to the documentation page.

"		closed	Documentation	dev		fixed	apache, auth, PythonAuthenHandler		Ready for checkin	1	0	0	0	0	0
