Django

Code

Ticket #6612 (closed: fixed)

Opened 8 months ago

Last modified 3 months ago

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

Reported by: trbs Assigned to: nobody
Milestone: Component: Documentation
Version: SVN Keywords: apache, auth, PythonAuthenHandler
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

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 "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.

Attachments

6612.diff (0.6 kB) - added by Simon Greenhill on 06/14/08 01:36:46.

Change History

06/14/08 01:36:46 changed by Simon Greenhill

  • attachment 6612.diff added.

06/14/08 01:37:08 changed by Simon Greenhill

  • needs_better_patch changed.
  • has_patch set to 1.
  • stage changed from Unreviewed to Ready for checkin.
  • needs_tests changed.
  • needs_docs changed.

Could this be an apache bug?

06/14/08 09:35:19 changed by trbs

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

06/30/08 07:23:45 changed by mtredinnick

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

06/30/08 07:26:00 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [7804].


Add/Change #6612 (Apache auth recipe works but gives error in error_log in Apache 2.2)




Change Properties
Action