werc Bringing minimalism and sanity to the web

Werc Quick Setup for OpenBSD+Apache 1.3

This setup is based on an ftp install of OpenBSD (4.8 as of this writing). Just follow the instructions provided below and in five minutes you will have Apache configured to use werc.rc as CGI serving up HTML.

Apache chrooted

The base installation of OpenBSD comes with the Apache web server, version 1.3. It is not configured to run out of the box. If you choose to enable the web server, it will default to running in a chroot. In our opinion, this tends to cause more trouble than it is worth and the value of chrooting is, at the very least, debatable. We have chosen to go against the OpenBSD standard in this case by running the web server with the `-u' flag which causes it to run unchrooted. If you are a masochist and would like to try this setup with Apache as OpenBSD intended it, you should probably install Plan 9 from User Space in /var/www/usr/local/plan9. You will likely need to fiddle about with httpd.conf as well.

Acquire software

You will need to install the bzip2 package with pkg_add(1) in order to unarchive the werc tarball.

pkg_add bzip2
ftp http://hg.cat-v.org/werc/archive/tip.tar.bz2
tar xjf tip.tar.bz2
ftp http://dl.suckless.org/tools/9base-6.tar.gz
tar xzf 9base-6.tar.gz

Build p9p

I am using 9base as a minimal replacement for the full blown p9p, however the current version (9base-6 as of this writing) needs to be patched in order to build on OpenBSD.

cd 9base-6
ftp http://senet.us/9base-openbsd.diff
patch < 9base-openbsd.diff
make install clean

Move files/folders into place

A beautiful thing about werc is that it deals solely with flat files and directories. This makes it painless to set up, manage and configure.

mv ../werc-* /var/www/werc
cp -r /var/www/werc/sites/default.cat-v.org /var/www/werc/sites/your.domain.com
echo '# Hello World!' > /var/www/werc/sites/your.domain.com/index.md

Configure web server

As previously mentioned, we are going to run Apache unchrooted. In order to make this change permanent and automatically start the web server on boot, we need to modify /etc/rc.conf.local. Then we make the appropriate changes to the httpd.conf and start up the web server manually.

echo 'httpd_flags="-u"' >> /etc/rc.conf.local
cd /var/www/conf
cp httpd.conf httpd.conf.ORG
ed httpd.conf
httpd -u

To post a comment you need to login first.