Revisit Webfaction Hosting
Several years ago I hosted with webfaction for about a year. I was drawn to them at the time because they allowed SSH access and I could run Java applications on my account. Those were not common features available under shared hosting at the time. I didn’t end up deploying any Java applications and the PHP sites I did deploy routed through webfaction’s nginx to PHP configuration which frequently failed. That meant that many visitors to my site saw nginx errors rather than my web page. When they couldn’t resolve the issue I moved my hosting to hostgator and have been extremely happy ever since.
I recently decided to explore Python Flask with MongoDB and was looking at hosting options. Google App Engine is a little too restrictive and I’ve had a mixed experience while working on the Software Licensing system that I’ve developed for that platform. I considered several VPS options including Amazon EC2 and Linode. As I was looking around I thought about webfaction again.
Ready to run Flask and MongoDB
I did a little searching and found that I could deploy Flask applications easily on webfaction. I could also deploy a MongoDB instance on webfaction.
I decided to give them another try and paid my first month’s fee. With about an hour of setup I had successfully deployed a Python Flask “Hello World!” application and had a running MongoDB instance. It was surprisingly easy, especially considering that with any VPS solution I would have needed to setup and worry about a lot more than just my Flask application. It saved me time and money.
Caveat Emptor
What I don’t know is whether they have addressed nginx errors (I recall that they were 502 Bad Gateway errors). Apparently it’s related to the nginx server not getting a suitable reply from the application. If I find myself fighting with that again this time around I may end up on a VPS anyway, but for development, it’s hard to beat their pricing and flexibility.
I really hope it works out that I can run in production on webfaction. I’ll keep you posted.
Hi,
I gladly see that you managed in combining Flask and MongoDB on webfaction…
I’m curious to see how you did it ….
If both run without problem, I haven’t managed to establish the connection between the two. Once the database started, its says “waiting for connection…”. On the Flask app side, I get an Internal Server Error…
Could you provide more details ? That would be great !! Thanks
Hi Mannaia,
I do plan to post my notes about how I accomplished this. Here’s are some links I used:
http://docs.webfaction.com/software/mongodb.html
http://community.webfaction.com/questions/10140/mongodb-numactl
http://itrs.tw/wiki/Setting_up_pyramid_and_mongodb_on_webfaction
I used bottle instead of Flask:
http://community.webfaction.com/questions/3998/how-to-setup-a-python-bottle-application
http://docs.webfaction.com/software/python.html
Good luck.