From 697594eb5da3c897b640ba5ddc232f50e41fb3a8 Mon Sep 17 00:00:00 2001 From: Uriel Date: Fri, 10 Jul 2009 02:53:18 +0000 Subject: [PATCH] Documentation updates. - Fix dumb mistake in wman docs - Document Plan 9's httpd setup. --- sites/werc.cat-v.org/apps/wman/index.md | 1 + .../docs/web_server_setup/plan_9_httpd.md | 44 ++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/sites/werc.cat-v.org/apps/wman/index.md b/sites/werc.cat-v.org/apps/wman/index.md index 714d59e..44f9f6e 100644 --- a/sites/werc.cat-v.org/apps/wman/index.md +++ b/sites/werc.cat-v.org/apps/wman/index.md @@ -31,3 +31,4 @@ TODO * We don't handle compressed man pages, but this should be trivial to add. * Unix systems might use different macros for their man pages. * Search (using keywords? Google? grep?) +* Inferno contains man pages named like 'foo-0intro', which are refered as foo-intro(X), should automatically add (or remove) the extra '0' (Examples: sys-intro(2) and draw-intro(2)). diff --git a/sites/werc.cat-v.org/docs/web_server_setup/plan_9_httpd.md b/sites/werc.cat-v.org/docs/web_server_setup/plan_9_httpd.md index 60392eb..0ca357f 100644 --- a/sites/werc.cat-v.org/docs/web_server_setup/plan_9_httpd.md +++ b/sites/werc.cat-v.org/docs/web_server_setup/plan_9_httpd.md @@ -1,4 +1,46 @@ Setup werc with Plan 9's httpd ============================== -Coming soon, thanks to soul9! + +There are two main options, you can use Russ Cox's magic to cgi translator +(found in his contrib dir as cgi.c), or you can use the following script which +while simpler, it also lacks some features at the moment. + +Thanks to soul9 for the original idea of wrapping werc in a shell script that +would setup a cgi-like environment! + + + #!/bin/rc + + SERVER_NAME=$2 + REQUEST_URI=`{echo $*(15)} + REQUEST_URI=$REQUEST_URI(2) + REQUEST_URI=/ + REQUEST_METHOD=$*(16) + PLAN9=/ + + + echo 'HTTP/1.0 200 Ok + Connection: close + Server: werc/9.9.9' # This is whatever you like + + + cd /usr/web/bin/ + rfork + /bin/rc < ./werc.rc >[2]/usr/glenda/tmp/w/log # Use whatever location you like to log stderr, but make sure it is writable by none. + +Call this script werc-wrap, and put it in /rc/bin/ip/httpd/ + +Then in your /sys/lib/httpd.rewrite add a line like: + + /w @/magic/werc-wrap + +And this will run werc for all stuff under /w. Note that apparently httpd is +incapable of internally remapping the root directory, so until a solution is +found for this, you will have to keep your site in a sub-directory of the web +server root. + +**Notes**: This is experimental and work in progress, there are a couple of issues +with the werc code itself that might need fixing, in particular you will need +to replace the '%($"extraHeaders%)' in lib/headers.tpl with '% echo +$"extraHeaders' no clue why.