this is obsolete doc -- see http://doc.nethence.com/ instead

werc web framework install and config 

 

 

Introduction 

Tested on RHEL5. But it should also work on BSD systems. 

 

 

Prerequesites 

For "Plan9 from User Space", make sure this package is installed, 

rpm -q libXt-devel libXext-devel

Note. otherwise you would get those at build time, 

error: X11/IntrinsicP.h: No such file or directory
error: X11/StringDefs.h: No such file or directory
/usr/bin/ld: cannot find -lXext

 

 

Installation 

Fetch, deploy and build "Plan9 from User Space" (http://swtch.com/plan9port/), 

wget http://swtch.com/plan9port/plan9port.tgz
tar xzf plan9port.tgz
mv plan9/ /usr/local/
cd /usr/local/plan9/
./INSTALL

Note. no need to edit your system PATH, werc has got it built-in. 

 

Fetch and deploy werc (http://werc.cat-v.org/download/), 

wget http://werc.cat-v.org/download/werc-1.4.0.tar.gz
tar xzf werc-1.4.0.tar.gz
mv werc-1.4.0/ /usr/werc/

 

 

Apache2 configuration 

Create an Apache2 virtual host, 

cd /etc/httpd/conf.d/
vi werc.example.com.conf

like, 

<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
    </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>

note. change werc.example.com accordingly 

apply, 

service httpd reload

 

If you point your browser to werc.example.com at this point, you'll see werc but with some kind of 404. 

 

 

werc configuration 

Eventually edit the general settings, 

cd /usr/werc/etc/
sed '/^$/d; /^#/d;' initrc > initrc.local
vi initrc.local

 

 

werc site configuration 

Create a werc virtual host based the test suite, 

cd /usr/werc/sites/
cp -Rp tst.cat-v.org werc.example.com
chown -R apache:wheel werc.example.com/

 

Eventually edit the site settings, 

cd /usr/werc/sites/werc.example.com/
cd _werc/
vi config

Ref. http://werc.cat-v.org/docs/config-options 

 

Prevent favicon httpd 404 error logs, 

cd /usr/werc/sites/werc.example.com/
touch favicon.ico

 

 

Ready to go 

Point your browser to your virtual host, 

http: //werc.example.com

 

 

References 

http://werc.cat-v.org/ 

http://werc.cat-v.org/docs/ 

http://swtch.com/plan9port/ 

http://swtch.com/plan9port/man/man1/install.html 

http://werc.cat-v.org/docs/web-server-setup/apache2 

 

 

Other references 

http://www.gnu.org/software/gawk/manual/gawkinet/html_node/CGI-Lib.html#CGI-Lib 

http://thedailywtf.com/Articles/Announcing-APDB-The-Worlds-Fastest-Database.aspx