Add to git.
[pthrlib.git] / examples / README
1 Examples
2 --------
3
4 pthr_eg1_*
5
6         This is a very basic example webserver which simply
7         prints out the query string and a few other details
8         like request headers when you connect to it.
9
10         Run it as:
11
12         ./pthr_eg1_echo -p 8002
13
14         and then try connecting to it (eg. with lynx, netscape, etc.):
15
16         http://localhost:8002/something
17
18 pthr_eg2_*
19
20         This is a slightly more advanced example. This webserver
21         will serve flat files (only). It can be used for benchmarking,
22         profiling/optimizing the library, or even as a very simple
23         production webserver.
24
25         It needs to be started as ``root'' because it chroots and
26         changes its user ID for security reasons.
27
28         All configuration is by way of command line arguments. Try
29         typing ``./pthr_eg2_server --help'' for a complete list.
30
31         This webserver is capable of exploiting the full power
32         of SMP machines.
33
34         To start it (as root):
35
36         ./pthr_eg2_server -p 8003 -r /home/httpd/html -u nobody
37
38         If you have more than one processor, then you need to
39         use the ``-n'' argument to tell it how many processors
40         you have.
41
42         Tip for benchmarking: use a lot of client machines
43         connected through a full-duplex ethernet switch to
44         the server. On each client machine, run a recursive
45         ``wget'' to download a large number of files, eg:
46
47         wget -r http://server:8003/
48
49 rws
50
51         RWS is a full-featured webserver built on top of pthrlib.
52         It is distributed separately. You can get it from
53         http://www.annexia.org/freeware/rws/