Jud Dagnall Photography Blog

Photography, technology and occasional rants!

Switching from blosxom to pyblosxom

Posted on October 26th, 2004 in by jud || No Comment

That didn’t take long. 24 hours later and I’ve switched to using python and
pyblosxom.

I’d looked at pyblosxom originally, but decided to use the perl version
instead since it appeared to have more plugins. However, I’d much rather
be working on python code, and after a closer look, I saw that pyblosxom
appeared to have all the plugins I really need.

Unfortunately, the pyblosxom setup was much more complex. Fortunately, all
the data is compatible. Here’s what I did to switch from blosxom to pyblosxom:

  1. Download pyblosxom
  2. Download pyxml
  3. extract each of the tarballs e.g.:
        $ tar xzvf fn.gz        # replace fn.tgz with the appropriate filename
        
  4. Build each module. This was a little trickier because I run python2.4
    (pre-release) on my staging server, but my ISP provider only runs 2.3.4. So I
    need to force my local (staging) server to use python2.3:

        $ python2.3 setup.py build
        
  5. Now, because I don’t have root access on my ISP’s server, I need
    to install the python files in a local root. This is done using the –home
    option during module installation, which puts everything in a home directory:

        $ cd pyblosxom-1-0-0
        $ python2.3 setup.py install --home $HOME
        

    Now I have a ~/lib, and pehaps a ~/bin and ~/share directory. The
    share directory can be discarded, since I just install the files from
    the extracted tarball directory.

  6. Now I need to get python to use this new directory. My first thought was
    to set the PYTHONPATH environmental variable to use $HOME/lib/python.
    However, since my ISP is running an older apache that doesn’t support the
    SetEnv directive, I simply used the “codebase” config parameter in config.py.
    Unfortunately I’ll have hardcode the path into any other python cgi script.
    Hmmm. Perl is looking a little better :)

    So I set:

        py["codebase"] = "/path/to/my/home/lib/python"
        
  7. Now to install the executables, I basically followed the install
    instructions. Since my blog lives at /blog, and not in a cgi-bin directory, I
    install it into my $DOCROOT (e.g. ~/public_html)

        $ cp web/pyblosxom.cgi $DOCROOT/pyblosxom.cgi      
        $ cp web/config.cgi    $DOCROOT/public_html/config.py
        
  8. However, since my ISP has python 1.5.1 as python, I need to specifify
    that the script should use python2.3. I replace the first line of
    pyblosxom.cgi with “#!/usr/bin/env python.2.3”
  9. After moving the config and pyblosxom files, I modified the config file
    to use all the same settings as blosxom, except I created a pyplugin
    directory so I could keep both pyblosxom and blosxom active during testing
    and deployment.
  10. After some testing, things were working well. I installed the file
    plugin so that I could share page static page items between my php and
    pyblosxom, and I moved the primary blog over to pyblossom.

That’s it. I moved pyblog.cgi to blog.cgi, and now pyblosxom is the default
engine. Next on my todo list is to install the reStructuredText plugin,
because I HATE hand-coding xhtml.

Leave a Reply

Your email address will not be published. Required fields are marked *