changelog shortlog tags branches changeset files revisions annotate raw help

Mercurial > hg > werc / sites/werc.cat-v.org/docs/web-server-setup/nhttpd.md

changeset 635: dd58ad29ffbf
parent: sites/werc.cat-v.org/docs/web_server_setup/nhttpd.md@1cc0baf72ae2
author: Uriel <u@berlinblue.org>
date: Sun, 30 May 2010 18:04:04 +0000
permissions: -rw-r--r--
description: Replace '_' in paths in werc's docs section with '-', and set up apropriate redirects to avoid broken links.
1 Nhttpd/Nostromo Web Server Configuration for Werc
2 ==================================================
3 
4 Contributed by nsz, thanks!
5 
6 The last two sections are relevant: aliases (to make non-content site material,
7 like css, available) and virtual hosts (the document root is set to `werc.rc`
8 so it will handle every request).
9 
10  # MAIN [MANDATORY]
11 
12  servername main.host.com
13  serveradmin admin[at]mail.com
14  serverroot /var/nostromo
15  servermimes conf/mimes
16  logpid logs/nhttpd.pid
17  logaccess logs/access_log
18  docroot /var/nostromo/htdocs
19  docindex index.html
20 
21  # SETUID [RECOMMENDED]
22 
23  user nhttpd
24 
25  # BASIC AUTHENTICATION [OPTIONAL]
26  #...
27 
28  # SSL [OPTIONAL]
29  #...
30 
31  # CUSTOM RESPONSES [OPTIONAL]
32  #...
33 
34  # HOMEDIRS [OPTIONAL]
35  #...
36 
37  # ALIASES [OPTIONAL]
38 
39  /pub /path/to/werc/pub
40  # The following line doesn't work because nhttpd doesn't support file aliases yet.
41  #/favicon.ico /path/to/werc/pub/default_favicon.ico
42 
43  # VIRTUAL HOSTS [OPTIONAL]
44 
45  vhost1.com /path/to/werc/bin/werc.rc
46  vhost2.com /path/to/werc/bin/werc.rc
47  #...
48 
49 To use werc on `main.host.com` as well just set `docroot` to `/path/to/werc/bin/werc.rc`
50 and set `docindex` to empty string.
51 
52 There was a bug in nhttpd <=1.9, it did not set `SERVER_NAME` properly (left it `main.host.com`).
53 To solve this problem just add a
54 
55  SERVER_NAME=$HTTP_HOST
56 
57 line somewhere at the top of `werc.rc`.
58 
59 
60