Opened 8 years ago

Closed 7 years ago

#6612 closed (fixed)

Apache auth recipe works but gives error in error_log in Apache 2.2

Reported by: trbs Owned by: nobody
Component: Documentation Version: master
Severity: Keywords: apache, auth, PythonAuthenHandler
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


The recipe on the documentation page 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 ""
    AuthBasicAuthoritative Off
    AuthUserFile /dev/null
    Require valid-user

    SetEnv DJANGO_SETTINGS_MODULE mysite.settings
    PythonAuthenHandler django.contrib.auth.handlers.modpython

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.

Attachments (1)

6612.diff (620 bytes) - added by Simon Greenhill 7 years ago.

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by Simon Greenhill

comment:1 Changed 7 years ago by Simon Greenhill

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

Could this be an apache bug?

comment:2 Changed 7 years ago by trbs

if i remember correctly this had something todo with the changes to mod_auth in apache 2.2

comment:3 Changed 7 years ago by mtredinnick

This should only be required for Apache 2.2, so I'm going to make the change specific to that section only.

comment:4 Changed 7 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [7804].

Note: See TracTickets for help on using tickets.
Back to Top