[mod_python] Question about mod_python configuration

Graham Dumpleton grahamd at dscpl.com.au
Mon Jan 22 05:09:04 EST 2007


On 22/01/2007, at 8:32 PM, export at hope.cz wrote:

> Graham ,
> Thank you for your reply
>
>> Please do the following:
>>
>> 1. Give the exact location of where the mptest.py now is. Does the  
>> user
>> that Apache runs as have permission to search that location and read
>> the handler file?
>
>  mptest.py is now  in the (working)location:
> C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test
>
> Yes, the users have the permission ( I test it on my XP windows)
>
>
>> 2. Give the URL that you are now using and expect to match to that
>> handler.
> Working URL was: http://127.0.0.1/test/mptest.py?17624
>
> I am trying( but not working )
> http://127.0.0.1/mod/mptest.py?17624

That isn't going to work as your Apache configuration isn't set up to  
have URLs
beginning with /mod use mod_python. You would need to use:

<Location /mod>
  AddHandler mod_python .py
  PythonPath "[' C:/MyDirectory/projects/mimproject/apps/mimi/ 
ModPythonPom/views/mod'] + sys.path"
  PythonHandler mptest
  PythonDebug On
</Location>

You might want to read up Apache documentation as to what Location and
Directory directives actually mean.

>>
>> 3. Give what error message the browser is giving back or otherwise
>> indicate
>> what sort of error you are getting that makes you believe it isn't
>> working.
> Mod_python does NOT find the handler ( mptest.py) at all in the new  
> location that is
> C:/MyDirectory/projects/mimproject/apps/mimi/ModPythonPom/views/mod
>
> Not working  httpd.conf( a part)  :
> <Directory "C:/Program Files/Apache Software Foundation/Apache2.2/ 
> htdocs/test">
>  AddHandler mod_python .py
>  PythonPath "[' C:/MyDirectory/projects/mimproject/apps/mimi/ 
> ModPythonPom/views/mod'] +
> sys.path"
>        PythonHandler mptest
>    PythonDebug On
>   </Directory>
>
>
>
>>
>> 4. Look in the Apache error log and give whatever error messages  
>> appear
>> there which relates to the failed request.
> Mod_python does NOT find the handler ( mptest.py) at all in the new  
> location
>
>
> Thank you for help
> Lad.
>
>
>
>
>
>
>>
>> If you can give this information our guesses may be better. :-)
>>
>> Graham
>>
>>> Thank you for help
>>> Lad
>>>
>>>
>>>
>>>> export at hope.cz wrote:
>>>>> I am able to use mod_python with this configuration
>>>>>
>>>>> <Directory "C:/Program Files/Apache Software Foundation/
>>> Apache2.2/htdocs/test">
>>>>>         AddHandler mod_python .py
>>>>>        PythonHandler mptest
>>>>>       PythonDebug On
>>>>>   </Directory>
>>>>>
>>>>> where server root is
>>>>>  "C:/Program Files/Apache Software Foundation/Apache2.2"
>>>>>
>>>>>
>>>>> But now I would like to  move PythonHandler  ( here mptest) to
>>> a different place.
>>>>> I need  the PythonHandler to  be in
>>>>>
>>>>> C:/MyDirectory/projects/mimproject/apps/mimi/ModPythonPom/views/
>>> mod
>>>>>
>>>>> How must change the above configuration so that I can use
>>> mod_python?
>>>>
>>>> The easiest way is to use the PythonPath directive to include your
>>>> handler in the search path. See
>>>> http://www.modpython.org/live/current/doc-html/dir-other-pp.html
>>>>
>>>> So use something like:
>>>>
>>>> <Directory "C:/Program Files/Apache Software
>>>> Foundation/Apache2.2/htdocs/test">
>>>>    PythonPath "sys.path +
>>>> ['C:/MyDirectory/projects/mimproject/apps/mimi/ModPythonPom/views/
>>> mod']"
>>>>    AddHandler mod_python .py
>>>>    PythonHandler mptest
>>>>    PythonDebug On
>>>> </Directory>
>>>>
>>>> Note that the PythonPath statement above should be on one line.
>>> There
>>>> might be line wrapping issues with this message.
>>>>
>>>> Jim
>>>
>>> _______________________________________________
>>> 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