15 Nov 2006

Junebug and Nginx

So I came across Junebug today, which is a slick wiki engine that harnesses the power of Camping and gives you a nice-looking wiki that’s contained in one directory.

Here’s what I did to get it setup and running and proxied through nginx:

1. Install Junebug (you’ll need Ruby Gems for this to work):

$ sudo gem install junebug

2. Create the wiki:

$ junebug wiki

3. Edit the config.yml file’s url and feed parameters to the location we’ll proxy it to, say http://example.com/wiki

4. Edit your nginx.conf and add the following entries:


upstream junebug {
server 127.0.0.1:3301;
}

location /wiki {
proxy_pass http://mongrel-kmw/wiki;
proxy_redirect off;
proxy_set_header Host $host;
}

location /wiki/static {
root /home/kmarsh;
}

5. Fire it up!: ./wiki start (this daemonizes automatically)

6. Restart nginx (send it HUP kill -HUP [nginx pid])

7. Visit your wiki at the URL you specified above, maybe http://example.com/wiki