[mod_python] 500 errors from authentication example

Graham Dumpleton grahamd at dscpl.com.au
Wed Oct 25 23:48:54 EDT 2006


Doug Daniels wrote ..
> Hello,
> 
> I had a bit of trouble running the authentication example at
> http://www.modpython.org/live/current/doc-html/tut-more-complicated.html
> .
> I'm working on Mac OS X v 10.4, running:
> 
> Apache: 2.2.3
> Python: 2.4
> mod_python: 3.2.10
> 
> When I tried to use the sample code and conf file directives, I got a 500
> error from apache.  In the error log I saw:
> 
> [Wed Oct 25 22:53:30 2006] [error] [client 127.0.0.1] (9)Bad file
> descriptor: Could not open password file: (null)
> [Wed Oct 25 22:53:57 2006] [error] Internal error: pcfg_openfile() called
> with NULL filename
> 
> As per some random advice here:
> 
> http://www.mail-archive.com/[email protected]/msg02163.html
> 
> I added the 'AuthBasicAuthoritative off' directive to the directory
> definition in the conf file, and the issue went away.
> 
> Anyone know what's up here?  Is this a known issue, and if so should the
> tutorial be changed?

Things changed in Apache 2.2 to cause this. The problem has been noted
before on developer mailing list at:

  http://mail-archives.apache.org/mod_mbox/httpd-python-dev/200604.mbox/%[email protected]%3e

There area a few comments there about it.

In short though, if you want to be able to supply your own handler for Basic
or Digest authentication in Apache 2.2, you need to set AuthBasicAuthoritative
to Off.

  http://httpd.apache.org/docs/2.2/mod/mod_auth_basic.html

The preferred way in Apache 2.2 is not even to define your own handler
but provide an auth provider which implements the means to merely
authenticate the login/password. At this point in time though, mod_python
doesn't provide a means of specifying auth providers although the need
for it is recorded at:

  http://issues.apache.org/jira/browse/MODPYTHON-169

So yes, the documentation needs updating, as do a lot of other areas
of the documentation. We are hoping in the future to get the documentation
into a form where that may be easier to do. At the moment the form that
the documentation is in, isn't conducive to easily making changes.

Graham


More information about the Mod_python mailing list