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:
- Download pyblosxom
- Download pyxml
- extract each of the tarballs e.g.:
$ tar xzvf fn.gz # replace fn.tgz with the appropriate filename
- 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
- 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. - 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"
- 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
- 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” - 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. - 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