December 26, 2014

How to install Cheetah on Dreamhost

cheetah How to install Cheetah on DreamhostInstalling 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 setup.py 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 ~/mydomain.com
    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.

[tags]python,dreamhost,cheetah,cheetahtemplates,howto[/tags]

Share and Enjoy:
  • services sprite How to install Cheetah on Dreamhost
  • services sprite How to install Cheetah on Dreamhost
  • services sprite How to install Cheetah on Dreamhost
  • services sprite How to install Cheetah on Dreamhost
  • services sprite How to install Cheetah on Dreamhost
  • services sprite How to install Cheetah on Dreamhost
  • services sprite How to install Cheetah on Dreamhost
  • services sprite How to install Cheetah on Dreamhost

Related posts:

  1. AJAX goodness for Invisible Castle I just rolled my first real AJAX application out to...
  2. Helpful Django utilities and links Two simple links which have been very helpful in doing...
  3. WordPress 2 multi-blogging made easy I upgraded the site to Wordpress 2 this morning. This...

About Bruce Kroeze

Comments

  1. Essk says:

    Just wanted to say thanks – it works great!

  2. name says:

    works great for me too

  3. fred says:

    Great work, I am hosting on dreamhost now.

Speak Your Mind

*