[mod_python] SetHandler and a subdirectory with static contents (images)

Arcady Genkin agenkin-lst-mod_python at thpoon.com
Sat Nov 16 20:24:19 EST 2002


vio <vmilitaru at sympatico.ca> writes:

> Looks like you forgot to include the python suffix, which restricts what
> file types are to be handled by mod_python.publisher. Try it like this:
>
> <IfModule mod_python.c>
> <Directory /var/www/data>
>     AddHandler python-program .py
>     PythonHandler mod_python.publisher
>     PythonDebug On
> </Directory>
> </IfModule>

Note that I am using the SetHandler directive (not AddHandler), which
does not require the file extension.  This is the recommended
configuration directive for 3.0, as per the docs.

Can anybody tell me how to work around this?

> Arcady Genkin wrote:
>
>> I cannot send image files when using the Publisher handler: apache
>> tries to run them as Python programs. ;^)  I tried setting to handler
>> for the images directory to the default, but it didn't work.  With
>> Apache 2.0.43 and mod_python-3.0B4, I have the following config:
>>
>> ,----[ httpd.conf ]
>> | <Directory "/var/www/data">
>> |    PythonDebug On
>> |    SetHandler python-program
>> |    PythonHandler mod_python.publisher
>> | </Directory>
>> |
>> | <Directory "/var/www/data/images">
>> |   SetHandler default-handler
>> | </Directory>
>> `----
>>
>> Since /var/www/data is the DocumentRoot, I cannot place the images in
>> a directory outside of it...
>>
>> What am I doing wrong?

-- 
Arcady Genkin : CDF Systems Administrator
http://www.cdf.toronto.edu/~agenkin/contact.html

guilt is the cause of more disauders
than history's most obscene marorders (E.E. Cummings)



More information about the Mod_python mailing list