Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 47 lines (29 sloc) 2.908 kB
c27bd80 edit
anonymous authored
1 ---
2 layout: default
5699087 edit
anonymous authored
3 title: Using web.py on TextDrive
c27bd80 edit
anonymous authored
4 ---
5
5699087 edit
anonymous authored
6 # Using web.py on TextDrive
c27bd80 edit
anonymous authored
7
52acb4b AaronSw
anonymous authored
8 [TextDrive](http://textdrive.com/) graciously provided me with a free shared hosting account to try to get web.py running on their system. I'm keeping notes on what I did here.
5699087 edit
anonymous authored
9
10 I got assigned `aaronsw.textdriven.com` on the server `cardero.textdrive.com` -- you should replace these in my instructions with whatever your server names are.
11
1bd6fae edit
anonymous authored
12 ## Getting it up
13
14 First, [file a support ticket](http://help.textdrive.com/index.php?pg=request) requesting a port to run web.py on. Apparently filing such a ticket [is standard practice](http://help.textdrive.com/index.php?pg=kb.page&id=106) 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).
5699087 edit
anonymous authored
15 Second, SSH to `aaronsw.textdriven.com` and run:
16
17 cd web/public/
18 mkdir work
19 cd work
20 wget http://webpy.org/web.py
21 # copy my script to code.py in this directory
22 python code.py 8048
23
24 Now check `http://aaronsw.textdriven.com:8048/` -- you should see your script working.
25
1bd6fae edit
anonymous authored
26 Now you can log into your webmin (`https://webmin.cardero.textdrive.com/`), 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 `http://aaronsw.textdriven.com:8048/` (don't forget to include the n in textdriven!) in the second box. Click "Save". Then click "Apply Changes" (in the upper right corner).
27
28 Now check `http://aaronsw.textdriven.com/` -- you should see your script working again.
29
f196da5 alexdong
anonymous authored
30 ## Install Cheetah
31
7792e2b gsiener
anonymous authored
32 Installing Cheetah on TextDrive is quite straight forward. Check [here](http://thetruedelight.blogspot.com/2006/12/how-to-install-cheetah-on-textdrive_19.html) to see the full installation script.
f196da5 alexdong
anonymous authored
33
1bd6fae edit
anonymous authored
34 ## Keeping it up
35
36 In your SSH window, type Ctrl-C to kill the Python script and run:
37
38 python ~aaronsw/web/public/work/code.py 8048 2>/dev/null &
39 This will run your web.py app as a daemon, so you can log out and it will stay running.
40
6e88faa edit
anonymous authored
41 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".
42
f99c96c edit
anonymous authored
43 (Note: My server hasn't rebooted yet, so I haven't gotten a chance to test that this works.)
44
45 ## Making it fast
46
3ea9d07 reverting a spammers mess
anonymous authored
47 For reasons I don't quite understand lighttpd proxying to web.py is faster than running web.py 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 web.py through FastCGI. TextDrive has a [knowledge base article](http://help.textdrive.com/index.php?pg=kb.page&id=252) on setting up lighttpd.
Something went wrong with that request. Please try again.