Ken Bradshaw
bradshak at us.ibm.com
Thu Oct 6 14:07:48 EDT 2005
Hello All, I've recently taken an interest in python and mod_python in particular. For the past two years or so I've been developing enterprise web apps in j2ee with WebSphere Applications Server and Portal Server, so I'm pretty used to pouring over documentation when configuration issues arise. Unfortunately, I haven't found a solution to my problem regarding the PythonHandler mod_python.publisher. Here's a brief synopsis of my environment and problem. Environment: I just used the standard packages provided by apt-get. Debian 3.1 stable apache 2.0.54 mod_python 3.1.3 Python 2.3.5 Configuration: file: /etc/apache2/sites-available/default <Directory /var/www/mod_python> AllowOverride FileInfo </Directory> --for whatever reason I had to add this to get the .htaccess to work. file: /var/www/mod_python/.htaccess AddHandler python-program .py .psp PythonHandler mptest #PythonHandler mod_python.publisher | .py PythonHandler mod_python.psp | .psp PythonDebug On file: /var/www/mod_python/mptest.py from mod_python import apache def handler(req): req.content_type="text/html" req.write("<html><body>") req.write("Hello World!") req.write("</body></html>") return apache.OK Problem: With the .htaccess configured as above, mptest.py works correctly when I point the browser to http://localhost/mod_python/mptest and prints the Hello World! I comment line 2 of the .htaccess and uncomment line 3, and the browser reports a 404 Error stating that The requested URL /mod_python/mptest.py was not found on this server(note that the URL remained the same in the browser). I also find it interesting to note that in either configuration, the PythonHandler mod_python.psp functions correctly, and the apache2/access.log and error.log report nothing more than a 404 error. Now I thought about just removing the mod_python.publisher altogether and using multiple Python handlers for the .py files, but the implementation failed for some reason. My plan was to make an entry for each .py file in the same way you would make an entry for every servlet in a web.xml file. It seems as though no matter where or in what order I put the PythonHandler lines in, if I make a call to one of them, all of them are executed. This I assume, means that I really have to have a mod_python.publisher working. Any help would be greatly appreciate. Regards, Ken Bradshaw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20051006/fe7f5840/attachment.html
|