Find file
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (29 sloc) 2.84 KB
layout title
Using on TextDrive

Using on TextDrive

TextDrive graciously provided me with a free shared hosting account to try to get running on their system. I'm keeping notes on what I did here.

I got assigned on the server -- you should replace these in my instructions with whatever your server names are.

Getting it up

First, file a support ticket requesting a port to run on. Apparently filing such a ticket is standard practice for running web apps on TextDrive. You'll get back a number, which we'll call 8048 (obviously you'll want to replace this with the actual number you get). Second, SSH to and run:

cd web/public/
mkdir work
cd work
# copy my script to in this directory
python 8048

Now check -- you should see your script working.

Now you can log into your webmin (, click "Apache Webserver", click "Aliases and Redirects", and scroll down to "Map local to remote URLs". Add a line with / in the first box, check the second radio button, and put (don't forget to include the n in textdriven!) in the second box. Click "Save". Then click "Apply Changes" (in the upper right corner).

Now check -- you should see your script working again.

Install Cheetah

Installing Cheetah on TextDrive is quite straight forward. Check here to see the full installation script.

Keeping it up

In your SSH window, type Ctrl-C to kill the Python script and run:

python ~aaronsw/web/public/work/ 8048 2>/dev/null &

This will run your app as a daemon, so you can log out and it will stay running.

To make sure that the server starts your script back up when it reboots, go into webmin, click "Scheduled Cron Jobs", click "Create a new scheduled cron job", and add this as the command. Click the radio button next to "Simple schedule..." and select "When system boots" from the drop down menu. Then click "Create".

(Note: My server hasn't rebooted yet, so I haven't gotten a chance to test that this works.)

Making it fast

For reasons I don't quite understand lighttpd proxying to is faster than running directly. So if you want your server to support more serious loads, you should run a simple lighttpd instance on port 8048 and have it talk to through FastCGI. TextDrive has a knowledge base article on setting up lighttpd.