apache.md (2603B)
1 Setup werc with Apache 2 ====================== 3 4 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. 5 6 Apache 1.3.x: minimalist configuration 7 ====================================== 8 9 No virtual hosts and let werc handle static files. 10 11 RewriteEngine On 12 ServerName test.cat-v.org 13 AddHandler cgi-script .rc 14 15 <Directory /var/www/werc/bin> 16 Options ExecCGI 17 </Directory> 18 <IfModule mod_dir.c> 19 DirectoryIndex /werc.rc 20 </IfModule> 21 22 RewriteRule /werc.rc /var/www/werc/bin/werc.rc 23 DocumentRoot /var/www/werc/bin/ 24 ErrorDocument 404 /werc.rc 25 26 27 Apache 1.3.x: standard configuration 28 ==================================== 29 30 This lets apache handle static files. 31 32 <VirtualHost *> 33 34 RewriteEngine On 35 ServerName test.cat-v.org 36 AddHandler cgi-script .rc 37 38 <Directory /var/www/werc/bin> 39 Options ExecCGI 40 </Directory> 41 <IfModule mod_dir.c> 42 DirectoryIndex /werc.rc 43 </IfModule> 44 45 RewriteRule (.*) /var/www/werc/sites/%{HTTP_HOST}/$1 46 47 RewriteCond %{REQUEST_FILENAME} !-f 48 RewriteRule .* /var/www/werc/bin/werc.rc 49 50 RewriteRule /werc.rc /var/www/werc/bin/werc.rc 51 DocumentRoot /var/www/werc/bin/ 52 ErrorDocument 404 /werc.rc 53 54 </VirtualHost> 55 56 57 Apache 1.3.x: advanced configuration 58 ==================================== 59 60 61 <VirtualHost *> 62 63 RewriteEngine On 64 ServerName cat-v.org 65 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 66 AddHandler cgi-script .rc 67 AddHandler cgi-script .cgi 68 <Directory /home/uriel/cat-v.org/bin> 69 Options ExecCGI 70 </Directory> 71 <IfModule mod_dir.c> 72 DirectoryIndex /werc.rc 73 </IfModule> 74 75 RewriteRule ^/hg/(.*) /home/uriel/cat-v.org/bin/hgwebdir.cgi/$1 [L] 76 77 RewriteRule /pub/style/style.css /home/uriel/cat-v.org/pub/style/style.css [L] 78 RewriteRule /pub/ /home/uriel/cat-v.org/pub/ [L] 79 RewriteRule /favicon.ico /home/uriel/cat-v.org/pub/default_favicon.ico [L] 80 81 82 RewriteRule (.*) /home/uriel/cat-v.org/sites/%{HTTP_HOST}/$1 83 84 RewriteCond %{REQUEST_FILENAME} !-f 85 RewriteRule .* /home/uriel/cat-v.org/bin/werc.rc 86 87 RewriteRule /werc.rc /home/uriel/cat-v.org/bin/werc.rc 88 DocumentRoot /home/uriel/cat-v.org/bin/ 89 ErrorDocument 404 /werc.rc 90 91 </VirtualHost> 92 93