WebFaction
Community site: login faq

I am wanting to deploy my web.py app on web faction. I am though, a complete newbie to apache etc so I was wondering if someone could give me a step by step guide of how I should install and run my app?

asked 06 Feb '11, 05:50

Oetzi
112
accept rate: 0%

edited 06 Feb '11, 05:51


http://webpy.org/install shows at least a couple of easy-to-deploy scenarios that would work on our side, namely, Apache with CGI using .htaccess (that would correspond to a Static/CGI/PHP app on our side) and mod_wsgi.

The Apache + CGI scenario is probably easier to understand and deploy as it requires just couple of lines to be added to an .htaccess file. If you prefer to deploy it under mod_wsgi instead, you may take a look at the following forum thread: http://forum.webfaction.com/viewtopic.php?pid=8184#p8184

permanent link

answered 06 Feb '11, 06:10

tie
1.4k13
accept rate: 44%

Where do I put my files if I use Apache + CGI? And what web app do I use?

(06 Feb '11, 07:50) Oetzi

You would use a Static/CGI/PHP app. You would put the files inside the directory that corresponds to your app, e.g. ~/webapps/<app_name>/

(06 Feb '11, 07:55) tie

I tried this and I get a Internal Server Error when I try and access the site. My code works on the web py test server so it must be the deployment. Anything you can suggest?

(06 Feb '11, 08:23) Oetzi

You should take a look at the error logs of your application (under ~/logs/frontend) - they will probably contain a clue about what went wrong.

If you are unable to find anything, you can contact our support service, so we ca take a look as well.

(06 Feb '11, 08:27) tie

Also if I try running my file via "python app.py" on the server over ssh it runs.

(06 Feb '11, 08:28) Oetzi

I get 'premature end of script headers' on my script. Should I put up my code?

(06 Feb '11, 08:48) Oetzi

This is a generic error, which could be caused by a lot of things, like wrong permissions for example. Please try setting 0755 permissions to your app.py file

If the problem still persists, post a support ticket, so we can take a look at your files.

(06 Feb '11, 08:54) tie

Still didn't work. I've added a ticket. The id is ZFS-429118.

(06 Feb '11, 09:13) Oetzi
showing 5 of 8 show 3 more comments

The guide at http://forum.webfaction.com/viewtopic.php?pid=8184#p8184 is really old. I am assuming the setup has changed as I noticed the following changes:

1)The guide has a step to install web.py into ~/webapps/myapp/lib/python2.5. When I create a mod_wsgi app using the control panel, the app only has a apache2 & htdocs folder. There is no lib folder created in the app. Should the folder get created automatically ? The discussion assumes the folders are there. They are not.

2)I created the lib folder and the python2.7 folder( i am trying to use the latest stable version) inside it and then ran the PYTHONPATH command as given in the discussion. It ran and installed web.py. But import web still fails causing a Internal Server Error in my app. The logs show ImportError: No module named web.

I am confused. It would be awesome if someone can help/update the answer.

permanent link

answered 08 Feb '11, 02:20

Rajat
524
accept rate: 0%

Hi Rajat,

What is your python-path= set to inside your apache2/conf/httpd.conf? If the new directory isn't on that it won't import web because it's not on the path.

(08 Feb '11, 02:57) klynton

Inside the apache2/conf in the httpd.conf the path was set to python2.6. I realised the mod_wsgi installation installs with python2.6 not python 2.7. So I went ahead and made a folder for python2.6 inside lib and ran the PYTHONPATH command again with the new path pointing to python2.6.

The installation for web.py succeeded in that folder. Yet I still get the Internal Server Error.

(08 Feb '11, 03:46) Rajat

Hi Rajat,

Did you restart the apache stack after making the changes above?

(08 Feb '11, 03:56) klynton

I did but still no success.

(08 Feb '11, 13:38) Rajat

You should submit a support ticket so we can see the code in real-time.

(08 Feb '11, 14:40) johns

Has there been any update on this one. I too want to run my apps on web.py and it seems to me its not as straight forward as installing a django or a php app? Does it have to be that way? Is there a step by step guide on how to get this working.

(10 Feb '12, 08:53) notnarayan
showing 5 of 6 show 1 more comments
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
×31
×25
×3

question asked: 06 Feb '11, 05:50

question was seen: 7,753 times

last updated: 10 Feb '12, 09:42

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