Add to git.
[rws.git] / README
1 rws - a fast, small and efficient web server written in C
2 written by Richard Jones <rich@annexia.org>
3
4 GENERAL INFO
5 ------------
6
7 ``rws'' is yet another web server. This one offers the advantage
8 that it is both cleanly written internally, as well as simple,
9 and, of course, very fast. Current features include:
10
11 * Serves files.
12 * Memory-mapped file cache.
13 * Serves directory listings.
14 * Supports virtual hosts.
15 * Supports aliases.
16 * CGI scripts (NPH scripts only).
17 * Shared object scripts (see below).
18 * Access and error logs.
19
20 The following are the features that I intend to add before I
21 declare that ``rws'' is complete:
22
23 * Run CGI scripts as a local user (similar to Apache suexec).
24 * IP-based access control.
25 * Manual pages.
26
27 INSTALLATION INSTRUCTIONS
28 -------------------------
29
30 You must install c2lib and pthrlib libraries first. Get these
31 from:
32
33         c2lib           http://www.annexia.org/freeware/c2lib/
34         pthrlib         http://www.annexia.org/freeware/pthrlib/
35
36 If you are having problems with ``rws'', make sure that you
37 have the latest versions of these libraries installed before
38 reporting any errors to me.
39
40 Build it:
41
42         ./configure --sysconfdir=/etc   [--prefix=/usr]
43         make+
44         make+ test
45
46 Install it (as root):
47
48         make+ install
49
50 As configured above the server installs itself as
51 /usr/local/sbin/rwsd, and expects to find configuration files in the
52 /etc/rws directory (unless you specify different --prefix and
53 --sysconfdir parameters).
54
55 Edit /etc/rws/rws.conf (which is the global level configuration file)
56 as appropriate for your site.
57
58 Edit /etc/rws/hosts/default to configure as required. Note that by
59 default, the document root is set to /usr/local/share/rws/html, which
60 just contains a demo page.
61
62 Start up the web server:
63
64         /usr/local/sbin/rwsd
65
66 These are early days. If you find a bug, please report it to me
67 by mailing rich@annexia.org. Please include a complete description.
68
69 FAQ
70 ---
71
72 1. The web server seems to have loads of memory leaks! It just sits
73    there sucking up more and more memory.
74
75    A. Not so. The web server stores a cache of memory mapped files,
76       making it quicker to serve the same file subsequent times.
77       Unfortunately top(1) or ps(1) count the memory mapped files
78       against the size of the process, even though they are never
79       really loaded into memory. To get a real picture of what's
80       going on, look at /proc/<<PID>>/maps and /proc/<<PID>>/fd/
81       (replace <<PID>> with the process ID of ``rws'').
82
83 2. What's all this about shared object scripts and .so files?
84
85    A. See doc/index.html
86
87 3. Can I run rws under Apache?
88
89    A. Yes, using mod_proxy. More instructions to come, but this is the
90       recommended approach if you want to integrate monolith applications
91       with your existing Apache-driven site.