Blog: pyBlosxom

Everyone and their mothers seems to be blogging these days, so we should allow that too (and if only for Planet Debian)

Goals

Steps

Install the pyblosxom package. No further steps are required on a global level. It is a good idea to create a central hierarchy for all blogs, and a group blogmasters for those allowed to add new blogs:

$ install -d -m 3771 -g blogmasters /srv/blogs

Also, drop the following file into this directory:

pyblosxom-proxy.cgi:

#!/bin/sh -e

cd ${0%/*} 2&>/dev/null || true
export PYTHONPATH=$(pwd):$PYTHONPATH
exec /usr/lib/cgi-bin/pyblosxom.cgi
_eof
$ chmod 755 /srv/blogs/pyblosxom-proxy.cgi

Adding a new blog site

To add a new blog site, make a new directory under /srv/blogs:

$ cd /srv/blogs
$ install -d -m711 my.blog.org

Now copy the /etc/pyblosxom/config.py file to the new directory and customise it to your liking. Make sure that www-data can read the file! Finally, hardlink the pyblosxom-proxy.cgi script to this directory:

$ cd my.blog.org
$ cp /etc/pyblosxom/config.py .
$ chmod a+r config.py
$ editor config.py
$ ln ../pyblosxom-proxy.cgi .

Now create a new apache2 site with the following configuration:

<Location />
  AllowOverride None
  Options None
</Location>

<Files config.py>
  Deny from all
</Files>

ScriptAlias / /srv/blogs/my.blog.org/pyblosxom-proxy.cgi/

I prefer to keep my blog entries under my home directory, so I did the following:

$ mkdir ~/blog
$ setfacl -d -m www-data ~/blog
$ setfacl -m www-data ~/blog
$ ln -s ~/blog entries
$ sed -i -e "1aimport os;s,^\(py\['datadir'\] =\).*,\1 os.getcwd() + '/entries'," config.py

ToDo: mod_python

configs/pyblosxom (last edited 2008-03-27 22:06:08 by gloria)