WebFaction
Community site: login faq

Currently, I have set up a custom application and can get it to serve pages if I ssh into my app and run the web.py server via "python myApp.py 23211" (where 23211 is the port specified in my control panel); however, if I don't have the web.py server running, nothing gets served (I just get 502 bad gateway).

What do I need to set up to run a web.py app as mod_wsgi on webfaction? Do I need to set up something in .htaccess? The web.py documentation seems to imply that I just need to add the mod_wsgi app lines in my web.py app and it should work.

EDIT:

So, it seemed that there was a conflict between python versions/paths because of the python3.1 specified in the default httpd.conf and the python I had installed web.py under; however, even after specifying the correct python version in httpd.conf and restarting apache, I am now getting this error in my apache error log:

mod_wsgi (pid=15233): Target WSGI script '/home/newUser/webapps/test/htdocs/index.py' cannot be loaded as Python module.
mod_wsgi (pid=15233): Exception occurred processing WSGI script '/home/newUser/webapps/test/htdocs/index.py'.
Traceback (most recent call last):
File "/home/newUser/webapps/test/htdocs/index.py", line 22, in <module>
  import web
  File "/home/newUsers/lib/python2.6/web/__init__.py", line 14, in <module>
  import utils, db, net, wsgi, http, webapi, httpserver, debugerror
ImportError: No module named utils

asked 26 Jan '13, 19:35

Jane29
112
accept rate: 0%

edited 27 Jan '13, 05:05


There is a post here that is similar to what you are asking. It points to the documentation here about 3/4 of the way down. That should help get things setup.

permanent link

answered 26 Jan '13, 20:20

bmeyer71 ♦♦
1.5k3613
accept rate: 33%

After trying all the suggested methods in the documentation, I am stil having issues. I get an import error no module named web when I use the defaul python-path supplied by the mod_wsgi application httpd.conf file (generated by webfaction). I installed web.py with python2.6 so I set the path to 2.6 and instead of no web module error, I now get no utils module after restarting apache which seems to be imported by web.py.

(27 Jan '13, 04:54) Jane29

Please open a ticket at our support site, and we'll help you find the cause of the issue.

(27 Jan '13, 11:15) timg ♦♦
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:

×97
×33
×3

question asked: 26 Jan '13, 19:35

question was seen: 5,905 times

last updated: 27 Jan '13, 11:15

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