Wanted to write this post as I am sure I may need to refer back to it at some point, and couldn’t find this info anywhere else…
Setting Up a web2py Instance on Webfaction
- Browse to the Webfaction Install Scripts Wiki: https://wiki.webfaction.com/wiki/InstallScripts
- You will be asked to login to your Webfaction account. Do so.
- The ‘Create Application’ form will be pre-filled for you! Very nice. All you need to do is enter a name for your application. In the screenshot below I simply called mine ‘myweb2py’.
- Click the ‘Save’ button. The script will run and a short time later the app will be ready to go.Just like with any other application that you setup on Webfaction, you’ll also need to create a domain (if it doesn’t already exist in your list) and then a ‘website’ record that correlates the domain(s) to the application(s). For web2py you will need to create two domains: one for administrative login (which requires https) and one for regular access. To accomplish this, do the following:
- While still in the control panel, go to the Domains page and add a new domain for your site. For this example, I’ll use ‘www.myweb2py.com’. So you’ll need to setup the www.myweb2py.com and myweb2py.com domains. Leave them unencrypted (http) which is the default. Click save.
- web2py’s administrative portal requires an https connection. Without it, you won’t be able to login to the web2py instance and create apps, etc. So we’ll do that next.
- Create a new domain for admin access. Example: if your site’s eventual domain is going to be www.myweb2py then one example might be: admin.myweb2py.com, but you can name it anything you like.
- Make sure to set it to encrypted HTTPS (very important)
- Save the record as before.
- Now, just as with any other Webfaction app, you’ll need to go to the Website page of the control panel and point the two domains to the web2py instance you previously installed.
- Wait a bit for the DNS to propogate, then browse to your new web2py instance via the https domain, login, and get to work!
In theory, the above should be all you need to do, but as of October, 2013 when I tried this, it didn’t work. After contact Webfaction support, it turns out there is one additional step (which they took care of for me – excellent!). There is an issue with their install script for web2py. Here is what they told me had to be done:
“It seems the problem was that the wsgihandler.py file specified in the httpd.conf was in the wrong location; it had to be one level up. I copied it up and restarted the application and it’s now working.”
I checked, and it works perfectly.
Important: your web2py Administrative password will be the same as your Webfaction password.
A Plug for web2py
I’m quickly becoming a big fan of the web2py framework. While I guess my java/OOP experience has me cringe a little at the mixing of logic in the views, it’s one of those things where you have to appreciate that the purpose of web2py is to get things done. And quickly. Yet maintainable. So far so good.
A Plug for Webfaction
I have personally contracted and/or used dozens of web hosting services over the years. There are plenty of good ones, and plenty of bad ones. The typical problem is not in features, but in reliability. Even though they all ‘guarantee’ high uptimes, the reality is that there is a big difference between a site being ‘up’ and a site loading so slowly that it is essentially down.
For the past year or so I’ve been using Webfaction and it is a fabulous hosting service, and continues to get better. They recently upgraded my shared hosting plan to 512MB of RAM – that very much exceeds the industry standard. If you’ve ever tried running mid-sized sites based on a Content Management System like Drupal, then you know that being able to throw more RAM at it can really help. For the $9 per month or so that I pay, I’ve found Webfaction to be fabulous.
But…it is geared towards developers. I would not recommend it for Joe Blog who simply needs a WordPress site. Although Webfaction does WordPress very well, setting up a new instance of any web application on WordPress is not the same as you would perform on just about any other web host. Most use Cpanel or some other type of one-click install process for the actual software, while the domain and application pointing (i.e., which domain should load which application(s), etc.) is largely handled automatically as part of the process. That’s great for Joe Blog but if you’re doing web development and use different frameworks/CMSs then I find Webfaction’s flexible approach to be excellent. For example, on my shared server I am presently running multiple WordPress sites, a few Drupal sites, a Django site, and now a web2py instance.