Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am trying to get web.py working.

I have compiled mod_wsgi to use python2.6, and configured my virtualhost correctly (at least I am pretty sure it is!). The hello, world application keeps showing up as 404. I changed the loglevel of Apache to info. and am seeing the following:

[Wed Sep 28 15:41:12 2011] [info] mod_wsgi (pid=25969): Attach interpreter ''.
[Wed Sep 28 15:42:55 2011] [info] mod_wsgi (pid=25969): Create interpreter 'clearpoint.turnleftllc.com|/budgetcalculator'.
[Wed Sep 28 15:45:33 2011] [info] mod_wsgi (pid=25969): Destroying interpreters.
[Wed Sep 28 15:45:33 2011] [info] mod_wsgi (pid=25969): Destroy interpreter 'clearpoint.turnleftllc.com|/budgetcalculator'.
[Wed Sep 28 15:45:33 2011] [info] mod_wsgi (pid=25969): Cleanup interpreter ''.
[Wed Sep 28 15:45:33 2011] [info] mod_wsgi (pid=25969): Terminating Python.
[Wed Sep 28 15:45:33 2011] [error] Exception KeyError: KeyError(-1216178416,) in <module 'threading' from '/usr/lib/python2.6/threading.pyc'> ignored
[Wed Sep 28 15:45:33 2011] [info] mod_wsgi (pid=25969): Python has shutdown.
Fatal Python error: Interpreter not initialized (version mismatch?)

Regarding the KeyError, I am really not sure where that is coming from. I tested the application from the command line (python26 code.py) and it executes without error. It gives no output whatsoever in fact.

Just in case, here is my VirtualHost configuration, as well as the application code:

Python Code (taken directly from the web.py site):

#!/usr/bin/python26
import web

urls = (
        '/.*', 'index'
        )

class index:
    def GET(self):
        return "Hello, world!"


app = web.application(urls,globals()).wsgifunc()

VirtualHost:

<VirtualHost xxx.xxx.xxx.xxx:80>
        ServerAdmin "tom@turnleftllc.com"
        ServerName clearpoint.turnleftllc.com
        ServerAlias clearpoint
        ErrorLog logs/clearpoint_error_log

        DocumentRoot /home/turnleftllc/public_html/cpccs
        WSGIScriptAlias /budgetCalculator /home/turnleftllc/public_html/cpccs/apps/code.py
        Alias /budgetCalculator/static /home/turnleftllc/public_html/cpccs/apps/static
        AddType text/html .py
        <Directory /home/turnleftllc/public_html/cpccs>
                Order allow,deny
                Allow from all
                AllowOverride All
        </Directory>
        <Directory /home/turnleftllc/public_html/cpccs/apps>
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>

I am using CentOS5, which defaults to python2.4. I did uninstall and recompile mod_wsgi for python2.6 (as you can see in the output, it's definitely initializing 2.6).

Any help would be greatly appreciated!

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Make sure you aren't still loading mod_python into same Apache.

Read the following and validate your installation.

http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Python_Shared_Library http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Python_Installation_In_Use

http://code.google.com/p/modwsgi/wiki/InstallationIssues

The KeyError message is because you are using old mod_wsgi version and not the latest so if you built from source code make sure you used mod_wsgi 3.3.

share|improve this answer
    
I definitely don't have mod_python in use.I did install 3.1; I'll try 3.3 instead and see if it helps! –  Tom Thorogood Sep 29 '11 at 3:42
    
Ah. never mind. I grepped around a bit. There was a separate .conf file that was loaded which had mod_python enabled. Good catch. Still not working right, but at least it's progress. Thanks for the help! –  Tom Thorogood Sep 29 '11 at 3:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.