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 |
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 answered 22 Apr '13, 08:35 valentini Thank you, I followed the steps. After I moved hello.py to $HOME/webapps/myapp/htdocs, it works :-)
(23 Apr '13, 00:20)
jirik
|