changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > werc / changeset: Add werc.cat-v.org/ site, it serves as sample site.

changeset 335: 7c4268db88ec
parent 334: 692643e96345
child 336: e68372204ab1
author: uriel@engel.se.cat-v.org
date: Tue, 20 Jan 2009 03:52:21 +0100
files: sites/werc.cat-v.org/_werc/config sites/werc.cat-v.org/docs/config_options.md sites/werc.cat-v.org/docs/rc_template_lang.md sites/werc.cat-v.org/docs/web_server_setup/apache.md sites/werc.cat-v.org/docs/web_server_setup/cherokee.md sites/werc.cat-v.org/docs/web_server_setup/lighttpd.md sites/werc.cat-v.org/docs/web_server_setup/nginx.md sites/werc.cat-v.org/docs/web_server_setup/nhttpd.md sites/werc.cat-v.org/docs/web_server_setup/plan_9_httpd.md sites/werc.cat-v.org/index.md sites/werc.cat-v.org/wiki/_werc/config
description: Add werc.cat-v.org/ site, it serves as sample site.
     1.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2+++ b/sites/werc.cat-v.org/_werc/config	Tue Jan 20 03:52:21 2009 +0100
     1.3@@ -0,0 +1,3 @@
     1.4+siteTitle='werc'
     1.5+siteSubTitle='Bringing minimalism and sanity to the web'
     1.6+
     4.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2+++ b/sites/werc.cat-v.org/docs/web_server_setup/apache.md	Tue Jan 20 03:52:21 2009 +0100
     4.3@@ -0,0 +1,92 @@
     4.4+Setup werc with Apache
     4.5+======================
     4.6+
     4.7+Note: Apache 2.x configuration should be similar to 1.3.x, but Apache 2.x is not recommended due to unwindy complexity, please use a saner web server.
     4.8+
     4.9+Apache 1.3.x: minimalist configuration
    4.10+======================================
    4.11+
    4.12+No virtual hosts and let werc handle static files.
    4.13+
    4.14+    RewriteEngine On
    4.15+    ServerName test.cat-v.org
    4.16+    AddHandler cgi-script .rc
    4.17+
    4.18+    <Directory /var/www/werc/bin>
    4.19+        Options ExecCGI
    4.20+    </Directory>
    4.21+    <IfModule mod_dir.c>
    4.22+        DirectoryIndex /werc.rc
    4.23+    </IfModule>
    4.24+
    4.25+    RewriteRule /werc.rc /var/www/werc/bin/werc.rc
    4.26+    DocumentRoot /var/www/werc/bin/
    4.27+    ErrorDocument 404 /werc.rc
    4.28+
    4.29+
    4.30+Apache 1.3.x: standard configuration
    4.31+====================================
    4.32+
    4.33+This lets apache handle static files.
    4.34+
    4.35+    <VirtualHost *>
    4.36+
    4.37+        RewriteEngine On
    4.38+        ServerName test.cat-v.org
    4.39+        AddHandler cgi-script .rc
    4.40+
    4.41+        <Directory /var/wwww/werc/bin>
    4.42+            Options ExecCGI
    4.43+        </Directory>
    4.44+        <IfModule mod_dir.c>
    4.45+            DirectoryIndex /werc.rc
    4.46+        </IfModule>
    4.47+
    4.48+        RewriteRule (.*) /var/www/werc/sites/%{HTTP_HOST}/$1
    4.49+
    4.50+        RewriteCond %{REQUEST_FILENAME} !-f
    4.51+        RewriteRule .* /var/www/werc/bin/werc.rc
    4.52+
    4.53+        RewriteRule /werc.rc /var/www/werc/bin/werc.rc
    4.54+        DocumentRoot /var/www/werc/bin/
    4.55+        ErrorDocument 404 /werc.rc
    4.56+
    4.57+    </VirtualHost>
    4.58+
    4.59+
    4.60+Apache 1.3.x: advanced configuration
    4.61+====================================
    4.62+
    4.63+
    4.64+    <VirtualHost *>
    4.65+
    4.66+        RewriteEngine On
    4.67+        ServerName cat-v.org
    4.68+        ServerAlias www.cat-v.org harmful.cat-v.org 9p.cat-v.org gsoc.cat-v.org doc.cat-v.org uriel.cat-v.org www.binarydream.org ninetimes.cat-v.org *.cat-v.org
    4.69+        AddHandler cgi-script .rc
    4.70+        AddHandler cgi-script .cgi
    4.71+        <Directory /home/uriel/cat-v.org/bin>
    4.72+            Options ExecCGI
    4.73+        </Directory>
    4.74+        <IfModule mod_dir.c>
    4.75+            DirectoryIndex /werc.rc
    4.76+        </IfModule>
    4.77+
    4.78+        RewriteRule ^/hg/(.*)    /home/uriel/cat-v.org/bin/hgwebdir.cgi/$1 [L]
    4.79+
    4.80+        RewriteRule /pub/style/style.css /home/uriel/cat-v.org/pub/style/style.css [L]
    4.81+        RewriteRule /pub/ /home/uriel/cat-v.org/pub/ [L]
    4.82+        RewriteRule /favicon.ico /home/uriel/cat-v.org/pub/default_favicon.ico [L]
    4.83+
    4.84+
    4.85+        RewriteRule (.*) /home/uriel/cat-v.org/sites/%{HTTP_HOST}/$1
    4.86+
    4.87+        RewriteCond %{REQUEST_FILENAME} !-f
    4.88+        RewriteRule .* /home/uriel/cat-v.org/bin/werc.rc
    4.89+
    4.90+        RewriteRule /werc.rc /home/uriel/cat-v.org/bin/werc.rc
    4.91+        DocumentRoot /home/uriel/cat-v.org/bin/
    4.92+        ErrorDocument 404 /werc.rc
    4.93+
    4.94+    </VirtualHost>
    4.95+
     5.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2+++ b/sites/werc.cat-v.org/docs/web_server_setup/cherokee.md	Tue Jan 20 03:52:21 2009 +0100
     5.3@@ -0,0 +1,31 @@
     5.4+Configuring werc with Cherokee
     5.5+==============================
     5.6+
     5.7+Contributed by sqweek, thanks!
     5.8+
     5.9+Cherokee Version 0.7.1
    5.10+----------------------
    5.11+
    5.12+    vserver!default!rule!600!only_secure = 0
    5.13+    vserver!default!rule!600!handler = cgi
    5.14+    vserver!default!rule!600!handler!error_handler = 1
    5.15+    vserver!default!rule!600!handler!check_file = 1
    5.16+    vserver!default!rule!600!handler!script_alias =
    5.17+    /usr/local/werc/bin/werc.rc
    5.18+    vserver!default!rule!600!handler!pass_req_headers = 0
    5.19+    vserver!default!rule!600!match = directory
    5.20+    vserver!default!rule!600!match!directory = /code
    5.21+    vserver!default!rule!600!match!final = 1
    5.22+
    5.23+
    5.24+Cherokee Version 0.5.3
    5.25+----------------------
    5.26+
    5.27+    Directory /code {
    5.28+           Handler cgi {
    5.29+               Scriptalias /usr/local/werc/bin/werc.rc
    5.30+           }
    5.31+    }
    5.32+
    5.33+
    5.34+Isn't progress wonderful?
     6.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2+++ b/sites/werc.cat-v.org/docs/web_server_setup/lighttpd.md	Tue Jan 20 03:52:21 2009 +0100
     6.3@@ -0,0 +1,40 @@
     6.4+Setup werc with lighttpd
     6.5+========================
     6.6+
     6.7+Minimal setup
     6.8+-------------
     6.9+This is the most minimal setup, for a single domain, and lets werc handle static files.
    6.10+
    6.11+    $HTTP["host"] =~ "^test\.cat-v\.org$" {
    6.12+        index-file.names = ( )
    6.13+        server.error-handler-404 = "/werc.rc"
    6.14+        alias.url       += ( "/werc.rc" => "/var/www/cat-v.org/bin/werc.rc" ) # Here use the path to werc.rc in your system.
    6.15+        cgi.assign += ( ".rc" => "")
    6.16+        server.dir-listing = "disable"
    6.17+    }
    6.18+
    6.19+Advanced setup
    6.20+--------------
    6.21+
    6.22+A more ellaborate setup, using virtual hosts to handle multiple domains, and
    6.23+alias to let lighttpd handle static files.  Also show how to add external cgi's
    6.24+to the setup, in this case Mercurial's web interface.
    6.25+
    6.26+    $HTTP["host"] =~ "^((harmful|9p|gsoc|doc|uriel|src|repo|www|)(\.|)cat-v\.org|(www\.)?binarydream.org|)$" {
    6.27+
    6.28+        index-file.names = ( )
    6.29+        evhost.path-pattern     = "/var/www/cat-v.org/sites/%3.%0/"
    6.30+        server.error-handler-404 = "/werc.rc"
    6.31+
    6.32+        alias.url       += ( "/pub/" => "/var/www/cat-v.org/pub/" )
    6.33+        alias.url       += ( "/favicon.ico" => "/var/www/cat-v.org/pub/default_favicon.ico" )
    6.34+        alias.url       += ( "/doc/" => "/var/www/cat-v.org/sites/doc.cat-v.org/" )
    6.35+        alias.url       += ( "/werc.rc" => "/var/www/cat-v.org/bin/werc.rc" )
    6.36+        alias.url       += ( "/debug.rc" => "/var/www/cat-v.org/bin/debug.rc" )
    6.37+        cgi.assign += ( ".rc" => "")
    6.38+        server.dir-listing = "disable"
    6.39+
    6.40+        cgi.assign += ( ".cgi" => "")
    6.41+        url.rewrite-once = ( "/hg/(.*)" => "/hg/hgwebdir.cgi/$1" )
    6.42+        alias.url       += ( "/hg/" => "/var/www/cat-v.org/bin/"  )
    6.43+    }
     7.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2+++ b/sites/werc.cat-v.org/docs/web_server_setup/nginx.md	Tue Jan 20 03:52:21 2009 +0100
     7.3@@ -0,0 +1,4 @@
     7.4+Setup werc with NGINX
     7.5+=====================
     7.6+
     7.7+No sample conf at the moment (please send me one if you have a setup using NGINX). You probably will want to to use [fcgiwrap](http://nginx.localdomain.pl/wiki/FcgiWrap)
     8.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2+++ b/sites/werc.cat-v.org/docs/web_server_setup/nhttpd.md	Tue Jan 20 03:52:21 2009 +0100
     8.3@@ -0,0 +1,56 @@
     8.4+Nhttpd config for werc
     8.5+======================
     8.6+
     8.7+Contributed by nsz, thanks!
     8.8+
     8.9+The last two sections are relevant: aliases (to make non-content site material,
    8.10+like css, available) and virtual hosts (the document root is set to `werc.rc`
    8.11+so it will handle every request).
    8.12+
    8.13+    # MAIN [MANDATORY]
    8.14+    
    8.15+    servername      main.host.com
    8.16+    serveradmin     admin[at]mail.com
    8.17+    serverroot      /var/nostromo
    8.18+    servermimes     conf/mimes
    8.19+    logpid          logs/nhttpd.pid
    8.20+    logaccess       logs/access_log
    8.21+    docroot         /var/nostromo/htdocs
    8.22+    docindex        index.html
    8.23+    
    8.24+    # SETUID [RECOMMENDED]
    8.25+    
    8.26+    user            nhttpd
    8.27+    
    8.28+    # BASIC AUTHENTICATION [OPTIONAL]
    8.29+    #...
    8.30+    
    8.31+    # SSL [OPTIONAL]
    8.32+    #...
    8.33+    
    8.34+    # CUSTOM RESPONSES [OPTIONAL]
    8.35+    #...
    8.36+    
    8.37+    # HOMEDIRS [OPTIONAL]
    8.38+    #...
    8.39+    
    8.40+    # ALIASES [OPTIONAL]
    8.41+    
    8.42+    /pub            /path/to/werc/pub
    8.43+    /favicon.ico        /path/to/werc/pub/default_favicon.ico
    8.44+    
    8.45+    # VIRTUAL HOSTS [OPTIONAL]
    8.46+    
    8.47+    vhost1.com      /path/to/werc/bin/werc.rc
    8.48+    vhost2.com      /path/to/werc/bin/werc.rc
    8.49+    #...
    8.50+
    8.51+To use werc on `main.host.com` as well just set `docroot` to `/path/to/werc/bin/werc.rc`
    8.52+and set `docindex` to empty string.
    8.53+
    8.54+There was a bug in nhttpd <=1.9, it did not set `SERVER_NAME` properly (leaft it `main.host.com`).
    8.55+To solve this problem just add a
    8.56+
    8.57+    SERVER_NAME=$HTTP_HOST
    8.58+
    8.59+line somewhere at the top of `werc.rc`.
     9.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2+++ b/sites/werc.cat-v.org/docs/web_server_setup/plan_9_httpd.md	Tue Jan 20 03:52:21 2009 +0100
     9.3@@ -0,0 +1,4 @@
     9.4+Setup werc with Plan 9's httpd
     9.5+==============================
     9.6+
     9.7+Coming soon, thanks to soul9!
    10.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2+++ b/sites/werc.cat-v.org/index.md	Tue Jan 20 03:52:21 2009 +0100
    10.3@@ -0,0 +1,8 @@
    10.4+Werc is a minimalist web framework built on the Unix and Plan 9 *tool philosophy* of software design.
    10.5+
    10.6+* Database free, uses files and directories instead.
    10.7+* Written using the rc shell, leveraging the standard unix/plan9 command toolkit.
    10.8+* Minimize tedious work: avoid having to write HTML, can use markdown instead.
    10.9+* Very minimalist yet extensible codebase: 150 lines of code highly functional core, with extra functionality in modular apps.
   10.10+
   10.11+
    11.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2+++ b/sites/werc.cat-v.org/wiki/_werc/config	Tue Jan 20 03:52:21 2009 +0100
    11.3@@ -0,0 +1,2 @@
    11.4+enable_wiki=yes
    11.5+enabled_apps=($enabled_apps bridge dirdir)