werc Bringing minimalism and sanity to the web

Apache 2 Example Werc Configurations

Example config provided by Gabriel Boquillon:

<VirtualHost *:80>
    RewriteEngine On

    # This is needed if plan9port isn't installed in /usr/local/plan9
    # You will need to set it in your environment before appache is started.
    PassEnv PLAN9

    ServerName cat-v.org
    ServerAlias www.cat-v.org harmful.cat-v.org www.binarydream.org ninetimes.cat-v.org *.cat-v.org

    AddHandler cgi-script .rc

    <Directory /srv/werc/bin>
        Options ExecCGI
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    # this is for sitemap.{txt,gz}
    <Directory /srv/werc/sites>
        Options FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    <IfModule mod_dir.c>
        DirectoryIndex /werc.rc
    </IfModule>

    RewriteRule /pub/style/style.css /srv/werc/pub/style/style.css
    RewriteRule /favicon.ico /srv/werc/pub/favicon.ico
    RewriteRule (.*) /srv/werc/sites/%{HTTP_HOST}/$1

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule .* /srv/werc/bin/werc.rc

    RewriteRule /werc.rc /srv/werc/bin/werc.rc
    DocumentRoot "/srv/werc/bin/"
    ErrorDocument 404 /werc.rc

    ErrorLog "/var/log/httpd/cat-v_error_log"
    CustomLog "/var/log/httpd/cat-v_access_log" common
</VirtualHost>

And an older config example ‘stolen’ from joshix, with corrections/fixes by Gabriel.

<VirtualHost *>
    RewriteEngine On
    ServerName werc.example.com
    ServerAlias ac.werc.example.com
    AddHandler cgi-script .rc
    AddHandler cgi-script .cgi
    <Directory /usr/werc/bin>
        Options ExecCGI
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    <IfModule mod_dir.c>
        DirectoryIndex /werc.rc
    </IfModule>

    RewriteRule (.*) /usr/werc/sites/%{HTTP_HOST}/$1

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule .* /usr/werc/bin/werc.rc

    RewriteRule /werc.rc /usr/werc/bin/werc.rc
    DocumentRoot /usr/werc/bin/
    ErrorDocument 404 /werc.rc
</VirtualHost>

For more extensive examples and instructions see also the apache 1.x config page.


To post a comment you need to login first.