misc.

werc

notes on setting up werc for lighttpd on debian 10.

links

/etc/lighttpd/lighttpd.conf

server.modules = (
    "mod_indexfile",
    "mod_access",
    "mod_alias",
    "mod_redirect",
    "mod_cgi",
    "mod_rewrite",
    "mod_accesslog",
)

# running on non-standard port so nginx can provide SSL.
server.port                 = 8080

# werc debug logs kept here:
server.breakagelog = "/var/log/lighttpd/breakage.log"

server.modules += (
    "mod_compress",
    "mod_dirlisting",
    "mod_staticfile",
)

$HTTP["host"] =~ "^(misc|)(\.|)reeddonaldson\.com$" {
    index-file.names = ( )
    server.error-handler-404 = "/werc.rc"
    alias.url += ( "/werc.rc" => "/var/www/werc/bin/werc.rc" )
    cgi.assign += ( ".rc" => "" )
    server.dir-listing = "disable"
    server.errorlog = "/var/log/lighttpd/reeddonaldson.com_error.log"
    accesslog.filename = "/var/log/lighttpd/reeddonaldson.com_access.log"
}

setup werc

read the documentation, and README!!!

place werc in /var/www/werc, set permissions:

chown -R :www-data /var/www/werc
chmod -R g+rws /var/www/werc/sites
setfacl -d -m g::rwx /var/www/werc/sites

it's important for www-data group to have write access on files/directories of sites with plugins that edit content. if you get 300 errors when changing a page using the wiki plugin, this is most often why.

because of the way I'm running werc on a non-standard port but proxy-ing from port 80/443, I needed to force SERVER_PORT=80 in /var/www/werc/bin/werc.rc just before the line base_url=http://$site:$SERVER_PORT.

redirects were broken before I did this