Add werc.cat-v.org/ site, it serves as sample site.
This commit is contained in:
		
							parent
							
								
									9f1f4ca37f
								
							
						
					
					
						commit
						79357e5c5a
					
				
					 11 changed files with 240 additions and 0 deletions
				
			
		
							
								
								
									
										92
									
								
								sites/werc.cat-v.org/docs/web_server_setup/apache.md
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										92
									
								
								sites/werc.cat-v.org/docs/web_server_setup/apache.md
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,92 @@ | |||
| Setup werc with Apache | ||||
| ====================== | ||||
| 
 | ||||
| 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. | ||||
| 
 | ||||
| Apache 1.3.x: minimalist configuration | ||||
| ====================================== | ||||
| 
 | ||||
| No virtual hosts and let werc handle static files. | ||||
| 
 | ||||
|     RewriteEngine On | ||||
|     ServerName test.cat-v.org | ||||
|     AddHandler cgi-script .rc | ||||
| 
 | ||||
|     <Directory /var/www/werc/bin> | ||||
|         Options ExecCGI | ||||
|     </Directory> | ||||
|     <IfModule mod_dir.c> | ||||
|         DirectoryIndex /werc.rc | ||||
|     </IfModule> | ||||
| 
 | ||||
|     RewriteRule /werc.rc /var/www/werc/bin/werc.rc | ||||
|     DocumentRoot /var/www/werc/bin/ | ||||
|     ErrorDocument 404 /werc.rc | ||||
| 
 | ||||
| 
 | ||||
| Apache 1.3.x: standard configuration | ||||
| ==================================== | ||||
| 
 | ||||
| This lets apache handle static files. | ||||
| 
 | ||||
|     <VirtualHost *> | ||||
| 
 | ||||
|         RewriteEngine On | ||||
|         ServerName test.cat-v.org | ||||
|         AddHandler cgi-script .rc | ||||
| 
 | ||||
|         <Directory /var/wwww/werc/bin> | ||||
|             Options ExecCGI | ||||
|         </Directory> | ||||
|         <IfModule mod_dir.c> | ||||
|             DirectoryIndex /werc.rc | ||||
|         </IfModule> | ||||
| 
 | ||||
|         RewriteRule (.*) /var/www/werc/sites/%{HTTP_HOST}/$1 | ||||
| 
 | ||||
|         RewriteCond %{REQUEST_FILENAME} !-f | ||||
|         RewriteRule .* /var/www/werc/bin/werc.rc | ||||
| 
 | ||||
|         RewriteRule /werc.rc /var/www/werc/bin/werc.rc | ||||
|         DocumentRoot /var/www/werc/bin/ | ||||
|         ErrorDocument 404 /werc.rc | ||||
| 
 | ||||
|     </VirtualHost> | ||||
| 
 | ||||
| 
 | ||||
| Apache 1.3.x: advanced configuration | ||||
| ==================================== | ||||
| 
 | ||||
| 
 | ||||
|     <VirtualHost *> | ||||
| 
 | ||||
|         RewriteEngine On | ||||
|         ServerName cat-v.org | ||||
|         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 | ||||
|         AddHandler cgi-script .rc | ||||
|         AddHandler cgi-script .cgi | ||||
|         <Directory /home/uriel/cat-v.org/bin> | ||||
|             Options ExecCGI | ||||
|         </Directory> | ||||
|         <IfModule mod_dir.c> | ||||
|             DirectoryIndex /werc.rc | ||||
|         </IfModule> | ||||
| 
 | ||||
|         RewriteRule ^/hg/(.*)    /home/uriel/cat-v.org/bin/hgwebdir.cgi/$1 [L] | ||||
| 
 | ||||
|         RewriteRule /pub/style/style.css /home/uriel/cat-v.org/pub/style/style.css [L] | ||||
|         RewriteRule /pub/ /home/uriel/cat-v.org/pub/ [L] | ||||
|         RewriteRule /favicon.ico /home/uriel/cat-v.org/pub/default_favicon.ico [L] | ||||
| 
 | ||||
| 
 | ||||
|         RewriteRule (.*) /home/uriel/cat-v.org/sites/%{HTTP_HOST}/$1 | ||||
| 
 | ||||
|         RewriteCond %{REQUEST_FILENAME} !-f | ||||
|         RewriteRule .* /home/uriel/cat-v.org/bin/werc.rc | ||||
| 
 | ||||
|         RewriteRule /werc.rc /home/uriel/cat-v.org/bin/werc.rc | ||||
|         DocumentRoot /home/uriel/cat-v.org/bin/ | ||||
|         ErrorDocument 404 /werc.rc | ||||
| 
 | ||||
|     </VirtualHost> | ||||
| 
 | ||||
							
								
								
									
										31
									
								
								sites/werc.cat-v.org/docs/web_server_setup/cherokee.md
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								sites/werc.cat-v.org/docs/web_server_setup/cherokee.md
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,31 @@ | |||
| Configuring werc with Cherokee | ||||
| ============================== | ||||
| 
 | ||||
| Contributed by sqweek, thanks! | ||||
| 
 | ||||
| Cherokee Version 0.7.1 | ||||
| ---------------------- | ||||
| 
 | ||||
|     vserver!default!rule!600!only_secure = 0 | ||||
|     vserver!default!rule!600!handler = cgi | ||||
|     vserver!default!rule!600!handler!error_handler = 1 | ||||
|     vserver!default!rule!600!handler!check_file = 1 | ||||
|     vserver!default!rule!600!handler!script_alias = | ||||
|     /usr/local/werc/bin/werc.rc | ||||
|     vserver!default!rule!600!handler!pass_req_headers = 0 | ||||
|     vserver!default!rule!600!match = directory | ||||
|     vserver!default!rule!600!match!directory = /code | ||||
|     vserver!default!rule!600!match!final = 1 | ||||
| 
 | ||||
| 
 | ||||
| Cherokee Version 0.5.3 | ||||
| ---------------------- | ||||
| 
 | ||||
|     Directory /code { | ||||
|            Handler cgi { | ||||
|                Scriptalias /usr/local/werc/bin/werc.rc | ||||
|            } | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| Isn't progress wonderful? | ||||
							
								
								
									
										40
									
								
								sites/werc.cat-v.org/docs/web_server_setup/lighttpd.md
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								sites/werc.cat-v.org/docs/web_server_setup/lighttpd.md
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,40 @@ | |||
| Setup werc with lighttpd | ||||
| ======================== | ||||
| 
 | ||||
| Minimal setup | ||||
| ------------- | ||||
| This is the most minimal setup, for a single domain, and lets werc handle static files. | ||||
| 
 | ||||
|     $HTTP["host"] =~ "^test\.cat-v\.org$" { | ||||
|         index-file.names = ( ) | ||||
|         server.error-handler-404 = "/werc.rc" | ||||
|         alias.url       += ( "/werc.rc" => "/var/www/cat-v.org/bin/werc.rc" ) # Here use the path to werc.rc in your system. | ||||
|         cgi.assign += ( ".rc" => "") | ||||
|         server.dir-listing = "disable" | ||||
|     } | ||||
| 
 | ||||
| Advanced setup | ||||
| -------------- | ||||
| 
 | ||||
| A more ellaborate setup, using virtual hosts to handle multiple domains, and | ||||
| alias to let lighttpd handle static files.  Also show how to add external cgi's | ||||
| to the setup, in this case Mercurial's web interface. | ||||
| 
 | ||||
|     $HTTP["host"] =~ "^((harmful|9p|gsoc|doc|uriel|src|repo|www|)(\.|)cat-v\.org|(www\.)?binarydream.org|)$" { | ||||
| 
 | ||||
|         index-file.names = ( ) | ||||
|         evhost.path-pattern     = "/var/www/cat-v.org/sites/%3.%0/" | ||||
|         server.error-handler-404 = "/werc.rc" | ||||
| 
 | ||||
|         alias.url       += ( "/pub/" => "/var/www/cat-v.org/pub/" ) | ||||
|         alias.url       += ( "/favicon.ico" => "/var/www/cat-v.org/pub/default_favicon.ico" ) | ||||
|         alias.url       += ( "/doc/" => "/var/www/cat-v.org/sites/doc.cat-v.org/" ) | ||||
|         alias.url       += ( "/werc.rc" => "/var/www/cat-v.org/bin/werc.rc" ) | ||||
|         alias.url       += ( "/debug.rc" => "/var/www/cat-v.org/bin/debug.rc" ) | ||||
|         cgi.assign += ( ".rc" => "") | ||||
|         server.dir-listing = "disable" | ||||
| 
 | ||||
|         cgi.assign += ( ".cgi" => "") | ||||
|         url.rewrite-once = ( "/hg/(.*)" => "/hg/hgwebdir.cgi/$1" ) | ||||
|         alias.url       += ( "/hg/" => "/var/www/cat-v.org/bin/"  ) | ||||
|     } | ||||
							
								
								
									
										4
									
								
								sites/werc.cat-v.org/docs/web_server_setup/nginx.md
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								sites/werc.cat-v.org/docs/web_server_setup/nginx.md
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,4 @@ | |||
| Setup werc with NGINX | ||||
| ===================== | ||||
| 
 | ||||
| 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) | ||||
							
								
								
									
										56
									
								
								sites/werc.cat-v.org/docs/web_server_setup/nhttpd.md
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										56
									
								
								sites/werc.cat-v.org/docs/web_server_setup/nhttpd.md
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,56 @@ | |||
| Nhttpd config for werc | ||||
| ====================== | ||||
| 
 | ||||
| Contributed by nsz, thanks! | ||||
| 
 | ||||
| The last two sections are relevant: aliases (to make non-content site material, | ||||
| like css, available) and virtual hosts (the document root is set to `werc.rc` | ||||
| so it will handle every request). | ||||
| 
 | ||||
|     # MAIN [MANDATORY] | ||||
|      | ||||
|     servername      main.host.com | ||||
|     serveradmin     admin[at]mail.com | ||||
|     serverroot      /var/nostromo | ||||
|     servermimes     conf/mimes | ||||
|     logpid          logs/nhttpd.pid | ||||
|     logaccess       logs/access_log | ||||
|     docroot         /var/nostromo/htdocs | ||||
|     docindex        index.html | ||||
|      | ||||
|     # SETUID [RECOMMENDED] | ||||
|      | ||||
|     user            nhttpd | ||||
|      | ||||
|     # BASIC AUTHENTICATION [OPTIONAL] | ||||
|     #... | ||||
|      | ||||
|     # SSL [OPTIONAL] | ||||
|     #... | ||||
|      | ||||
|     # CUSTOM RESPONSES [OPTIONAL] | ||||
|     #... | ||||
|      | ||||
|     # HOMEDIRS [OPTIONAL] | ||||
|     #... | ||||
|      | ||||
|     # ALIASES [OPTIONAL] | ||||
|      | ||||
|     /pub            /path/to/werc/pub | ||||
|     /favicon.ico        /path/to/werc/pub/default_favicon.ico | ||||
|      | ||||
|     # VIRTUAL HOSTS [OPTIONAL] | ||||
|      | ||||
|     vhost1.com      /path/to/werc/bin/werc.rc | ||||
|     vhost2.com      /path/to/werc/bin/werc.rc | ||||
|     #... | ||||
| 
 | ||||
| To use werc on `main.host.com` as well just set `docroot` to `/path/to/werc/bin/werc.rc` | ||||
| and set `docindex` to empty string. | ||||
| 
 | ||||
| There was a bug in nhttpd <=1.9, it did not set `SERVER_NAME` properly (leaft it `main.host.com`). | ||||
| To solve this problem just add a | ||||
| 
 | ||||
|     SERVER_NAME=$HTTP_HOST | ||||
| 
 | ||||
| line somewhere at the top of `werc.rc`. | ||||
|  | @ -0,0 +1,4 @@ | |||
| Setup werc with Plan 9's httpd | ||||
| ============================== | ||||
| 
 | ||||
| Coming soon, thanks to soul9! | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Uriel
						Uriel