WebFaction
Community site: login faq

Hello, I'm having a problem getting even a simple 'hello world' WSGI-based python app to run on Webfaction. Here are the steps that I did: 1. I created a new domain (hydrodata.eu). I checked that the nameservers are pointed to webfaction.com 2. I created a new website (hydrodata) and I linked it to the domain in webfaction's control panel. 3. I created a new application: myapp "WSGI application" and I linked it to the new hydrodata website.

Now when I log in to my account via SSH I have the following file structure: $HOME/webapps/myapp/apache2 $HOME/webapps/myapp/htdocs

Now I create an executable python file $HOME/webapps/myapp/hello.py

In the file I put the following code (I used example from Wikipedia WSGI article):

    def application(environ, start_response):
        start_response('200 OK', [('Content-Type', 'text/plain')])
        yield 'Hello Worldn'
Then I followed instruction to "restart apache server", I go to $HOME/webapps/myapp/apache2 and run ./restart

Now when I go in my browser to http://hydrodata.eu/hello.py I get a "404" error message "Not Found".

Any ideas what I'm doing wrong? Do I need to edit anything in the $HOME/webapps/myapp/apache2/conf/httpd.conf file?

asked 22 Apr '13, 05:59

jirik
121712
accept rate: 66%

edited 22 Apr '13, 06:00


Hello,

You will need to place the hello.py file inside the document root, which is $HOME/webapps/myapp/htdocs for a mod_wsgi application. Or change the DocumentRoot directive in the httpd.conf file.

Sincerely,

Valentin I. WebFaction Support

--

WebFaction - Smarter web hosting
http://webfaction.com
http://twitter.com/webfaction - http://facebook.com/webfaction

permanent link

answered 22 Apr '13, 08:35

valentini
2614
accept rate: 28%

Thank you, I followed the steps. After I moved hello.py to $HOME/webapps/myapp/htdocs, it works :-)

(23 Apr '13, 00:20) jirik
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:

×62
×52
×3

question asked: 22 Apr '13, 05:59

question was seen: 3,889 times

last updated: 23 Apr '13, 00:20

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