WebFaction
Community site: login faq

I've inherited a web application that is running python 2.5 (/usr/local/bin/python2.5) and I would to upgrade to python 2.7. I'd like to use ordereddict (and other things) offered in Python 2.7. I have installed python 2.7 (/usr/local/bin/python2.5) and I'm trying to figure out how to use that version with my web application. I can successfully run scripts using python 2.7 version. In my web application I've tried changing the line at the top of the script to #!/usr/local/bin/python2.7 but that doesn't seem to work. When I restart the webserver I see this in the logs, Apache/2.2.12 (Unix) mod_wsgi/2.5 Python/2.5.4 configured so it makes me think I have to change something in the apache or wsgi config to get it to use python 2.7.

I created a new application with the settings, mod_wsgi 3.4/Python 2.7. So the set up is currently like this:

~/webapps/old-app/htdocs running mod_wsgi 2.5/Python 2.5 mapped to www.originalapp.com ~/webapps/new-app/htdocs running mod_wsgi 3.4/Python 2.7 mapped to www.originalapp.com/newapp

When I browse to www.originalapp.com/newapp the page just gives the details that the page is served by mod_wsgi 3.4/Python 2.7. So then I copied the code from /old-app/htdocs to /new_app/htdocs. I restarted the http service at ~/webapps/new-app/apache2/bin/.restart. But when I browse to http://www.originalapp.com/newapp I get:

There was a problem with your request. Try Again.

When I check the error logs for the new_app there is the following:

[Tue Feb 18 01:11:11 2014] [notice] caught SIGTERM, shutting down [Tue Feb 18 01:12:34 2014] [notice] Apache/2.2.25 (Unix) mod_wsgi/3.4 Python/2.7.5 configured -- resuming normal operations

So there is no errors in the error log.

There is nothing interesting in the access logs for new-app. I even tried to stop the http service on the old-app (~/webapp/old-app/apache2/bin/.stop) while running the http service for the new-app. But that didn't do anything.

Any help is greatly appreciated!

asked 17 Feb '14, 16:27

user2743
1315
accept rate: 0%

edited 18 Feb '14, 04:27


You can't upgrade mod_wsgi from Python 2.5 to Python 2.7 by changing config - you have to use a mod_wsgi binary module that was built against Python 2.7.

My recommendation is that you install a new mod_wsgi + Python 2.7 app via our control panel, and then deploy your code under that app.

Hope that helps!

permanent link

answered 17 Feb '14, 22:56

seanf
12.2k41836
accept rate: 37%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×337
×225
×113
×55
×3

question asked: 17 Feb '14, 16:27

question was seen: 2,808 times

last updated: 18 Feb '14, 04:27

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM