No Warranty Expressed Or Implied
Lisp, music, electronics, 3D   |   john at johnp.net, john at synchromesh.com   |   John Pallister   |   Wellington, New Zealand & Norfolk, England
(me)
2011: Jan ( 1) Feb ( 1) Mar      Apr      May      Jun      Jul      Aug      Sep      Oct      Nov      Dec     
2009: Jan      Feb      Mar      Apr      May      Jun      Jul      Aug      Sep      Oct ( 3) Nov      Dec     
2008: Jan      Feb ( 1) Mar ( 3) Apr      May ( 3) Jun ( 2) Jul ( 2) Aug      Sep ( 1) Oct ( 1) Nov      Dec     
2007: Jan      Feb      Mar      Apr      May      Jun      Jul      Aug ( 1) Sep      Oct      Nov      Dec     
2006: Jan ( 8) Feb      Mar ( 2) Apr      May      Jun      Jul      Aug      Sep      Oct      Nov ( 2) Dec ( 3)
2005: Jan      Feb      Mar ( 5) Apr ( 9) May ( 4) Jun ( 3) Jul (12) Aug (12) Sep ( 3) Oct (15) Nov ( 8) Dec ( 8)
2004: Jan ( 6) Feb      Mar ( 1) Apr      May      Jun      Jul ( 3) Aug      Sep ( 4) Oct ( 8) Nov ( 6) Dec     
2003: Jan      Feb      Mar      Apr (11) May (14) Jun (10) Jul ( 6) Aug ( 7) Sep ( 5) Oct      Nov ( 7) Dec ( 7)
2002: Jan      Feb      Mar      Apr      May      Jun      Jul      Aug      Sep      Oct      Nov      Dec ( 1)
RSS 2.0

14 Oct 2009 Blog site setup

Nginx setup (in /etc/nginx/sites-available/blog.johnp.net):

server {
    listen      80;
    server_name blog.johnp.net;
    access_log  /home/www/blog.johnp.net/log/access.log;
    error_log   /home/www/blog.johnp.net/log/error.log;

    # Common include & image files.
    location ^~ /i/ {
        alias   /home/www/i/;
    }
    location ^~ /images/ {
        alias   /home/www/images/;
    }
    # There are only two non-blog URIs to worry about.
    location = /favicon.ico {
        alias   /home/www/blog.johnp.net/htdocs/favicon.ico;
    }
    location = /robots.txt {
        alias   /home/www/blog.johnp.net/htdocs/robots.txt;
    }
    # Pass all other URLs to PyBlosxom running under Paste.
    location ~ / {
        fastcgi_pass    localhost:4999;
        fastcgi_param   PATH_INFO $request_uri;
        include         fastcgi_params;
    }
}

My little server is running Ubuntu, which has /etc/nginx/fastcgi_params for all the "standard" CGI variables. But PyBlosxom wanted PATH_INFO as well.

Python Paste setup (in /home/john/blog/etc/blog.ini):

#!/usr/bin/env paster
[default]
debug = false

[exe]
command = serve
daemon = true
reload = true
reload-interval = 120
monitor-restart = true
pid-file = /home/john/blog/etc/paster.pid
log-file = /home/john/blog/log/paster.log

[server:main]
use = egg:Flup#fcgi_thread
host = 127.0.0.1
port = 4999

[app:main]
paste.app_factory = Pyblosxom.pyblosxom:pyblosxom_app_factory
configpydir = /etc/pyblosxom

Unfortunately the "executable shell script" stuff mentioned in the docs doesn't work too well for me (which it does warn you about), so I've wrapped the paste serve invocation into a short script:

#!/bin/bash
# serve-blog.sh - Run Python Paste to serve my PyBlosxom blog.
# File Created: 14 October 2009
# Author: John Pallister (mailto:john@synchromesh.com)

CONFIG_FILE=/home/john/blog/etc/blog.ini

/usr/bin/paster serve --daemon \
    --reload \
    --reload-interval=120 \
    --monitor-restart \
    --pid-file=/home/john/blog/etc/paster.pid \
    --log-file=/home/john/blog/log/paster.log \
    $CONFIG_FILE \
    $*

# End of serve-blog.sh

I have added this script to my rc.local to run at boot time.

Relevant bits of my PyBlosxom setup (in /etc/pyblosxom/config.py):

# 2 Oct 09 JDP Note: I have modified /usr/share/python-support/pyblosxom/Pyblosxom/pyblosxom.py
# to read '.blog' files instead of '.txt' files.
#
# Unused variables:
#   renderer
#   default_flavour
#
[snip]
py["datadir"] = "/home/john/blog/entries"

py["logdir"] = "/home/john/blog/log" # This doesn't seem to be used...
py["log_file"] = "/home/john/blog/log/pyblosxom.log"

py["log_level"] = "warning"
# The next two lines were good when debugging my archives plugin.
#py["log_level"] = "debug"
#py["renderer"] = "debug"

py["base_url"] = "http://blog.johnp.net"

py["flavourdir"] = "/home/john/blog/flavours"

py["plugin_dirs"] = ["/etc/pyblosxom/plugins", "/home/john/blog/plugins"]
py["load_plugins"] = ["disqus", "myarchives"]

py["cacheDriver"] = "entrypickle"
py["cacheConfig"] = "/var/run/pyblosxom-cache"

This is not the complete setup, but it has the interesting stuff. I copied the default HTML flavour files (content_type.html, date_head.html, foot.html, head.html, and story.html) into /home/john/blog/flavours/html.flav/ for tweaking.

Hopefully someone will find this useful.

[sites] # .
blog comments powered by Disqus


powered by PyBlosxom powered by Nginx Python Paste