[SPAM] Re: [mod_python] Apache/2.0.63 poping download box

Graham Dumpleton graham.dumpleton at gmail.com
Thu Aug 21 23:51:05 EDT 2008


2008/8/22 hh at dsgx.org <hh at dsgx.org>:
> the content of the file was downhere with the message's ill glue again here
> --
>
> from mod_python import apache
>
> def handler(req):
>        req.content_type = 'text/plain'
>                req.write("Hello World!")
>                        return apache.OK

Wrong indenting as I pointed out before, although that in itself will
not cause problem.

When you followed instructions in document I referred to, what
mod_python related configuration was in your main Apache configuration
and what was in your .htaccess file?

What did the Directory container in main Apache configuration for
directory where you were adding .htaccess file contain?

Were you restarting Apache between changes to main Apache configuration?

Finally, to ensure your .htaccess file was being read, literally add to it:

  MakeMeDieWith500 On

If the .htaccess file was actually being read, then you should get a
500 error back from your browser. If you don't then .htaccess file
wasn't being read after all.

Graham

> its the example hello world to test if python works just scroll down to
> check all my confs and what i did ---
> For simon
> here's the data collected
> ---
> Host -> www.dsgx.org
> User-agent -> Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.8.1.16)
> Gecko/20080702 Firefox/2.0.0.16
> Accept ->
> text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
> accept-language -> pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
> accept-ending ->gzip,deflate
> accept-charset -> ISO-8859-1,utf-8;q=0.7,*;q=0.7
> keep-alive -> 300
> connection -> keep-alive
> --
> And yes seems like its trying to act like a .gz file
>
>
>
>
> Bart escreveu:
>>
>> Check the contents of what it downloads. It might be some other
>> mod_python error (see also your apache error logs, it may tell you
>> more), or might be the python source which would probably mean that
>> the AddHandler/SetHandler does not affect the specific path for some
>> reason.
>>
>> Regards,
>> --Bart
>>
>>
>> On Thu, Aug 21, 2008 at 10:39 AM, Simon Bierbaum <bierbaum at vierfalt.com>
>> wrote:
>>
>>>
>>> What's in the file it lets you download? Download box sounds to me like a
>>> MIME type problem, i.e. your browser does not know how to display what
>>> it's
>>> being served by apache. req.content_type = 'text/plain' is correct,
>>> though.
>>> Maybe there's another directive in your httpd.conf which conflicts with
>>> this? Can you look at the HTTP response in Firefox with the Tamper Data
>>> add-on?
>>>
>>> Simon
>>>
>>> Am 21.08.2008 um 08:28 schrieb hh at dsgx.org:
>>>
>>>
>>>>
>>>> now after setting pythonpath like u guys need on freebsd im getting a
>>>> download box when i try to execute the python script
>>>> and i also added this to the directory
>>>>      AllowOverride FileInfo
>>>>
>>>> but still poping any idea ? thanks
>>>>
>>>> ---
>>>> hh at dsgx.org escreveu:
>>>>
>>>>>
>>>>> Still the same
>>>>> check the outcome
>>>>> http://www.dsgx.org/trac/mptest.py
>>>>> i solved the issue of the threading with including lib into apache now
>>>>> only problem is making the program run the .py
>>>>> btw im running freebsd 6.2
>>>>>
>>>>>
>>>>> Simon Bierbaum escreveu:
>>>>>
>>>>>>>>>
>>>>>>>>>     PythonHandler mptest
>>>>>>>>> [...]
>>>>>>>>> /home/augusto/www/trac/test.py
>>>>>>>>>
>>>>>>
>>>>>> Shouldn't the file be named mptest.py?
>>>>>>
>>>>>> Am 20.08.2008 um 23:52 schrieb hh at dsgx.org:
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> Ya i went there but still same problem from what i think is loading
>>>>>>> issue of mod_python.so so insted of using it . it just dumps the text
>>>>>>> into
>>>>>>> the screen
>>>>>>> :(
>>>>>>>
>>>>>>> Graham Dumpleton escreveu:
>>>>>>>
>>>>>>>>
>>>>>>>> Try starting over, including removing:
>>>>>>>>
>>>>>>>>  AddHandler python-program .py
>>>>>>>>
>>>>>>>> at global scope in configuration and follow instructions and
>>>>>>>> debugging
>>>>>>>> tips in:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>  http://www.dscpl.com.au/wiki/ModPython/Articles/GettingModPythonWorking
>>>>>>>>
>>>>>>>> Graham
>>>>>>>>
>>>>>>>> 2008/8/21 hh at dsgx.org <hh at dsgx.org>:
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> I installed mod_python using freebsd 6.x thru ports
>>>>>>>>> /usr/ports/www/mod_python3
>>>>>>>>> mod_python module was installed in
>>>>>>>>> --
>>>>>>>>> -rwxr-xr-x  1 root  wheel  121971 Aug 20 02:18
>>>>>>>>> /usr/local/libexec/apache2/mod_python.so
>>>>>>>>> --
>>>>>>>>> Added the line into my httpd.conf
>>>>>>>>> LoadModule python_module /usr/local/libexec/apache2/mod_python.so
>>>>>>>>> PythonOption mod_python.mutex_directory "/tmp"
>>>>>>>>> AddIcon /icons/p.gif .pl .py
>>>>>>>>> AddHandler python-program .py
>>>>>>>>>
>>>>>>>>> and tried to do that hello world test
>>>>>>>>> ----
>>>>>>>>> settup a directory entry like on tutorial
>>>>>>>>> --
>>>>>>>>> <Directory /home/augusto/www/trac>
>>>>>>>>>     AddHandler mod_python .py
>>>>>>>>>     PythonHandler mptest
>>>>>>>>>     PythonDebug On
>>>>>>>>> </Directory>
>>>>>>>>> ----
>>>>>>>>> -rwxr-xr-x  1 wwwrun  wwwrun  216 Aug 20 01:31
>>>>>>>>> /home/augusto/www/trac/test.py
>>>>>>>>> --
>>>>>>>>> inside ->
>>>>>>>>> from mod_python import apache
>>>>>>>>>
>>>>>>>>>  def handler(req):
>>>>>>>>>         req.content_type = 'text/plain'
>>>>>>>>>                 req.write("Hello World!")
>>>>>>>>>                         return apache.OK
>>>>>>>>> ----
>>>>>>>>>
>>>>>>>>> the error_log from my apache to make sure that the mod_python
>>>>>>>>> module
>>>>>>>>> was
>>>>>>>>> loaded
>>>>>>>>> ->
>>>>>>>>> Wed Aug 20 13:15:25 2008] [notice] Apache/2.0.63 (Unix)
>>>>>>>>> mod_python/3.3.1
>>>>>>>>> Python/2.5.2 PHP/4.4.9 configured -- resuming normal operations
>>>>>>>>> ---
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Everything seems to be normal but insted of reading the file it
>>>>>>>>> just
>>>>>>>>> dumps
>>>>>>>>> the text to my browser any ideias ??? Thanks alot.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> Mod_python mailing list
>>>>>>>>> Mod_python at modpython.org
>>>>>>>>> http://mailman.modpython.org/mailman/listinfo/mod_python
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Mod_python mailing list
>>>>>>> Mod_python at modpython.org
>>>>>>> http://mailman.modpython.org/mailman/listinfo/mod_python
>>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Mod_python mailing list
>>>>>> Mod_python at modpython.org
>>>>>> http://mailman.modpython.org/mailman/listinfo/mod_python
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> Mod_python mailing list
>>>> Mod_python at modpython.org
>>>> http://mailman.modpython.org/mailman/listinfo/mod_python
>>>>
>>>
>>> _______________________________________________
>>> Mod_python mailing list
>>> Mod_python at modpython.org
>>> http://mailman.modpython.org/mailman/listinfo/mod_python
>>>
>>>
>>
>> _______________________________________________
>> Mod_python mailing list
>> Mod_python at modpython.org
>> http://mailman.modpython.org/mailman/listinfo/mod_python
>>
>>
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>


More information about the Mod_python mailing list