[mod_python] Error testing installation of mod_python

Graham Dumpleton graham.dumpleton at gmail.com
Fri Mar 27 20:12:59 EDT 2009


2009/3/28 Tim Valenta <tonightslastsong at gmail.com>:
> I also had troubles trying to make a non-'publisher' handler work, and so
> rather than battling a hello world example, I had cut straight to the
> publisher, which felt more natural for the casual "I need to know how to
> work with mod_python" user.  I can't say that I was ready to be writing
> custom handlers (hello world tutorial or not), when resource
> routing/handling isn't the core of what I would look into a high-level
> language for.  That's the sort of thing that I would expect is already taken
> care of.

Which is why mod_python is a poor choice these days anyway. You are
better off using one of the Python web frameworks such as Django,
Pylons or TurboGears. For something more componentised, then try
Werkzeug.

> Might make a good tutorial to learn how to do it (and to clearly
> advertise that it's capable of such things) but when turned black and white:
>  publisher was the best way to simply get rolling.

For a tutorial see:

  http://webpython.codepoint.net/mod_python_tutorial

> I agree entirely that the page to which you've referenced is valuable
> information for correcting any problems being had.
> I also submit that mpinfo might not be worth the trouble to wrestle with if
> you don't need to know about your own local WinXP server right this instant.

The real question is whether mod_python is even worth the trouble
these days given that better options exist. ;-)

Graham

> Best of luck,
> Tim
>
> On Fri, Mar 27, 2009 at 5:48 PM, Graham Dumpleton
> <graham.dumpleton at gmail.com> wrote:
>>
>> 2009/3/28 Tim Valenta <tonightslastsong at gmail.com>:
>> >> Mostly irrelevant. They are using:
>> >>
>> >>  <Location /mpinfo>
>> >>  PythonHandler mod_python.testhandler
>> >
>> > Mostly not irrelevant, because it should be made sure that this
>> > specific location directive is the one being used.  If it's not
>> > included at all, then clearly a 404 would happen because it'd be
>> > looking for index.py files somewhere.
>> >
>> > Just wanted to clarify that I'm not a mumbling idiot.  I should have
>> > been more clear where I was coming from.
>>
>> The output they posted in the first message is what is output by the
>> mod_python.testhandler. You started talking about /mpinfo, which was
>> the URL he had mapped to that. Your explanation was therefore
>> irrelevant to the /mpinfo output as he produced it as it doesn't using
>> anything you talked about. What you talked about was also how
>> mod_python.publisher works, which isn't even the basic mod_python
>> handler mechanism which is most likely what he is trying to get going
>> because that is what is used for the first hello world example in the
>> mod_python documentation, not mod_python.publisher.
>>
>> The document I referenced gives better instructions on how to set up
>> that first basic mod_python handler.
>>
>> Graham
>>
>> > On Fri, Mar 27, 2009 at 5:33 PM, Graham Dumpleton
>> > <graham.dumpleton at gmail.com> wrote:
>> >>
>> >> 2009/3/28 Tim Valenta <tonightslastsong at gmail.com>:
>> >> > I notice that it says your gateway interface is CGI, but I'm not sure
>> >> > if
>> >> > that's what it always says or not.  (I have never quite payed
>> >> > attention to
>> >> > that part before.)
>> >>
>> >> You can ignore it as mod_python simply forces req.subprocess_env to be
>> >> populated with CGI stuff. This has side affect of adding it.
>> >>
>> >> > It took me a while to get used to the way mod_python decides if a URL
>> >> > maps
>> >> > to a function or not.  If I remember right, that "/mpinfo" call
>> >> > should look
>> >> > for an "mpinfo.py" file's "index" function.  (I think to reach
>> >> > index.py's
>> >> > "mpinfo" function, you'd have to pull a string or two more, or just
>> >> > request
>> >> > "/index/mpinfo").
>> >> > If I've gotten that wrong somehow, someone feel free to correct me,
>> >> > but
>> >> > that's how I remember it working.  I don't have it in front of me
>> >> > yet.
>> >>
>> >> Mostly irrelevant. They are using:
>> >>
>> >>  <Location /mpinfo>
>> >>  PythonHandler mod_python.testhandler
>> >>  SetHandler mod_python
>> >>  </Location>
>> >>
>> >> So, using internal module of mod_python. No file actually coming into
>> >> play.
>> >>
>> >> Original poster should read and work through:
>> >>
>> >>
>> >>  http://www.dscpl.com.au/wiki/ModPython/Articles/GettingModPythonWorking
>> >>
>> >> This may give them a clue as to what they are doing wrong.
>> >>
>> >> Graham
>> >>
>> >> > Tim
>> >> > 2009/3/27 Sandhya Uppada <sandhya.samson at gmail.com>
>> >> >>
>> >> >> Hi,
>> >> >>
>> >> >> I'm trying to install mod python on my Windows XP. I installed and
>> >> >> configured mod_python as per the installtion guide but when I test
>> >> >> it using
>> >> >> the simple "hello world" program, I get HTTP 404 Error. I'm new to
>> >> >> this and
>> >> >> need help in figuring this out. Following is the /mpinfo output. Pls
>> >> >> give me
>> >> >> some pointers that can look at and correct this error.
>> >> >>
>> >> >> Regards,
>> >> >> Sandhya
>> >> >>
>> >> >> Apache version Apache/2.2.11 (Win32) mod_python/3.3.1 Python/2.5.4
>> >> >> Apache threaded MPM Yes, maximum 64 threads / process
>> >> >> Apache forked MPM No (single process MPM)
>> >> >> Apache server root C:/Program Files/Apache Software
>> >> >> Foundation/Apache2.2
>> >> >> Apache document root C:/Program Files/Apache Software
>> >> >> Foundation/Apache2.2/htdocs
>> >> >> Apache error log C:/Program Files/Apache Software
>> >> >> Foundation/Apache2.2\logs/error.log (view last 100 lines)
>> >> >> Python sys.version 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC
>> >> >> v.1310
>> >> >> 32 bit (Intel)]
>> >> >> Python sys.path
>> >> >>
>> >> >> C:\WINDOWS\system32\python25.zip
>> >> >> C:\Python25\Lib
>> >> >> C:\Python25\DLLs
>> >> >> C:\Python25\Lib\lib-tk
>> >> >> C:\Program Files\Apache Software Foundation\Apache2.2
>> >> >> C:\Program Files\Apache Software Foundation\Apache2.2\bin
>> >> >> C:\Python25
>> >> >> C:\Python25\lib\site-packages
>> >> >>
>> >> >> Python interpreter name BOB_SANDY.domain_not_set.invalid
>> >> >> mod_python.publisher available Yes
>> >> >> mod_python.psp available Yes
>> >> >>
>> >> >> Request input headers
>> >> >>
>> >> >> Key Value
>> >> >> Accept image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
>> >> >> application/x-shockwave-flash, application/vnd.ms-excel,
>> >> >> application/vnd.ms-powerpoint, application/msword, */*
>> >> >> Accept-Language en-us
>> >> >> UA-CPU x86
>> >> >> Accept-Encoding gzip, deflate
>> >> >> User-Agent Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;
>> >> >> MSDigitalLocker; .NET CLR 1.1.4322; InfoPath.1)
>> >> >> Host localhost
>> >> >> Connection Keep-Alive
>> >> >>
>> >> >> Request environment
>> >> >>
>> >> >> Key Value
>> >> >> GATEWAY_INTERFACE CGI/1.1
>> >> >> SERVER_PROTOCOL HTTP/1.1
>> >> >> REQUEST_METHOD GET
>> >> >> QUERY_STRING
>> >> >> REQUEST_URI /mpinfo
>> >> >> SCRIPT_NAME /mpinfo
>> >> >> HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
>> >> >> application/x-shockwave-flash, application/vnd.ms-excel,
>> >> >> application/vnd.ms-powerpoint, application/msword, */*
>> >> >> HTTP_ACCEPT_LANGUAGE en-us
>> >> >> HTTP_UA_CPU x86
>> >> >> HTTP_ACCEPT_ENCODING gzip, deflate
>> >> >> HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;
>> >> >> MSDigitalLocker; .NET CLR 1.1.4322; InfoPath.1)
>> >> >> HTTP_HOST localhost
>> >> >> HTTP_CONNECTION Keep-Alive
>> >> >> PATH
>> >> >> C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program
>> >> >> Files\HPQ\IAM\bin;C:\Program Files\Java\jdk1.6.0_12\bin;C:\Program
>> >> >> Files\Sun\JavaDB\bin;C:\Python26;C:\Eclipse-SDK-3.4.1-win32\eclipse
>> >> >> SystemRoot C:\WINDOWS
>> >> >> COMSPEC C:\WINDOWS\system32\cmd.exe
>> >> >> PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
>> >> >> WINDIR C:\WINDOWS
>> >> >> SERVER_SIGNATURE
>> >> >> SERVER_SOFTWARE Apache/2.2.11 (Win32) mod_python/3.3.1 Python/2.5.4
>> >> >> SERVER_NAME localhost
>> >> >> SERVER_ADDR 127.0.0.1
>> >> >> SERVER_PORT 80
>> >> >> REMOTE_ADDR 127.0.0.1
>> >> >> DOCUMENT_ROOT C:/Program Files/Apache Software
>> >> >> Foundation/Apache2.2/htdocs
>> >> >> SERVER_ADMIN name at somedomain.com
>> >> >> SCRIPT_FILENAME C:/Program Files/Apache Software
>> >> >> Foundation/Apache2.2/htdocs/mpinfo
>> >> >> REMOTE_PORT 3354
>> >> >> _______________________________________________
>> >> >> Mod_python mailing list
>> >> >> Mod_python at modpython.org
>> >> >> http://mailman.modpython.org/mailman/listinfo/mod_python
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > "Python is the unholy bastard step-child between Ruby and PHP."
>> >> > "I'd let an ipod blow up on my leg for $150,000."
>> >> > "but Ben and Jerry do make a lovely couple."
>> >> >
>> >> > _______________________________________________
>> >> > Mod_python mailing list
>> >> > Mod_python at modpython.org
>> >> > http://mailman.modpython.org/mailman/listinfo/mod_python
>> >> >
>> >> >
>> >
>> >
>> >
>> > --
>> > "Python is the unholy bastard step-child between Ruby and PHP."
>> > "I'd let an ipod blow up on my leg for $150,000."
>> > "but Ben and Jerry do make a lovely couple."
>> >
>
>
>
> --
> "Python is the unholy bastard step-child between Ruby and PHP."
> "I'd let an ipod blow up on my leg for $150,000."
> "but Ben and Jerry do make a lovely couple."
>



More information about the Mod_python mailing list