[mod_python] Apache directory listing

Graham Dumpleton graham.dumpleton at gmail.com
Mon Jun 4 17:27:55 EDT 2007


On 05/06/07, Aaron Gallagher <habnabit at gmail.com> wrote:
> Haha, I worked it out a while ago anyway. It was a stupid problem;
> when I rebuilt apache, I forgot to change my modules directory over
> to being owned by the apache user. Everything is working perfectly
> now, but I have a new question anyway!
>
> Is it better to send documents chunked by calling req.send_http_header
> () and then using req.write unbuffered, or to send it all together by
> not using req.send_http_header() and with buffered req.write?

In Apache 2.X, send_http_header() is actually redundant.

The most time efficient way generally is to actually buffer output in
a Python list and then use:

  req.write(''.join(mylist))

Ie., write all data in one go.

This will probably use more memory, but less runtime overhead than
Apache doing the buffering.

Graham

> On May 30, 2007, at 6:45 PM, Graham Dumpleton wrote:
>
> > Apache runs as a special user. Are your modules and the full directory
> > path to where they are located readable to others?
> >
> > On 30/05/07, Aaron Gallagher <habnabit at gmail.com> wrote:
> >> I just completely cleaned out my apache install, reinstalled it, and
> >> it seems to be working, but I'm having problems again, and I've heard
> >> of other people having the same problem. Every mod_python module I
> >> try to load will not load, and the error I get is that the modules
> >> can't be found.
> >>
> >> I'm using a .pth file in my site-packages directory, and I can import
> >> the modules just fine from the interactive interpreter anywhere, and
> >> mod_python.testhandler is reporting that my module directory is in
> >> sys.path.
> >>
> >> So, what's going on?
> >>
> >> On May 29, 2007, at 10:49 PM, Aaron Gallagher wrote:
> >>
> >> > Hah, wow, I guess that explains everything.
> >> >
> >> > I got really frustrated with all of my bizarre problems, so I tried
> >> > testing it on another machine.
> >> >
> >> > Everything worked _perfectly_. No problems whatsoever. Apache
> >> > autoindexed my directories and everything.
> >> >
> >> > The first thing I did was check the versions, and they're both
> >> > running apache 2.0.59 with mod_python 3.3.1. Weird.
> >> >
> >> > I'm going to do a complete reinstall of apache and see if that
> >> > fixes everything on the server. I hope so.
> >>
> >> Aaron Gallagher
> >> <habnabit at gmail.com>
> >>
> >>
> >>
>
> Aaron Gallagher
> <habnabit at gmail.com>
>
>
>


More information about the Mod_python mailing list