How to install Cheetah on Dreamhost

Installing Cheetah on Dreamhost’s shared servers is actually a snap, if you have access to a Linux development system. All you have to realize is that the servers are Intel-based Linux systems, Python setup utilities know how to build “dumb” distribution, and that python doesn’t care if you use symlinks to trick it.

Building Cheetah

      1. Skip this step, if you like, by downloading my precompiled Dreamhost-friendly version. Download: Cheetah-1.0.linux-i686.tar.gz (MD5 Signature: 5e64240ae6dd7eb0ffe92fdde61fe5ea)
      2. To build, go to a Linux computer, preferably Debian, with Python 2.3 installed.
      3. Download Cheetah. I’ve tested this with 1.0. I don’t know about 2.0, probably the same steps would work.
      4. Unpack Cheetah in a temp dir. tar xzf Cheetah-1.0.tar.gz
      5. Compile a “dumb distribution” cd Cheetah-1.0 python bdist_dumb --relative
      6. Copy the compiled distribution to Dreamhost. You’ll find it at “dist/Cheetah-1.0.linux-i686.tar.gz”

Installing Cheetah

      1. Unpack the compiled Cheetah package in some directory. I’ll assume you are going to unpack it in your home directory. tar xzf Cheetah-1.0.linux-i686.tar.gz
      2. It will unpack into two directories.
        • lib/python2.3/site-packages/Cheetah — the compiled site packages
        • bin — Cheetah compiler binary
      3. Now, you need to edit your ~/.bash_profile and add a couple lines: PATH=$PATH:$HOME/bin PYTHONPATH=$PYTHONPATH:$HOME/lib/python2.3/site-packages export PATH PYTHONPATH
      4. Now, add the environment variables to your current session. source /.bash_profile
      5. At this point, Cheetah should work! Congratulations!
      6. If it compiles all right, but doesn’t work via the web, then you need to make sure your Cheetah dir is available from your web-context pythonpath. The easiest, hackiest, fastest way to do this is to simply make a symlink to Cheetah. This fools Python into seeing the “Cheetah” module in the same place it sees your project files. My domain has its Python cgi files right in the root, so I just did it like this: cd ~/ ln -s ~/lib/python2.3/site-packages/Cheetah .

Please let me know how this works for you, I’ll attempt to help you out if you run into problems.

Coders Eye - Web Dev Tutorials and How-To Guides for Beginners
Enable registration in settings - general