source: trunk/minix/commands/httpd/README@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 8.9 KB
Line 
1httpd documentation 7/16/96 by Michael Temari <Michael@TemWare.Com>
2updated 2003-07-05 by Al Woodhull <awoodhull@hampshire.edu>
3
4DISCLAIMER:
5
6Use at own risk etc...
7
8
9COMMENTS:
10
11Please send me any bug reports, comments, questions, etc... My email
12address is Michael@TemWare.Com
13
14
15BACKGROUND:
16
17httpd is a World Wide Web (WWW) server. I wrote it from scratch so
18the setup and configuration will not be like other web servers though
19hopefully by reading this document there will be no problems in getting
20my web server up and running on your Minix system.
21
22
23COMPILING:
24
25To compile httpd all you need to do is type "make" in the httpd source
26directory. There should be no errors or warnings. If you should run
27out of memory when compiling try adding the -m option to the CFLAGS
28list in the Makefile.
29
30
31INSTALLING:
32
33To install httpd all you need to do is type "make install" in the httpd
34source directory. By default the place to install httpd is into
35/usr/local/bin. If you would like to change this then change BINDIR in
36the Makefile. Httpd will be linked to in.httpd, which is the preferred
37name for a program started by the tcpd internet access control program.
38The program dir2html is also installed -- this provides a directory
39listing when a web client accesses a directory which does not contain a
40file named index.html (or an alternative designated in /etc/httpd.conf).
41The man pages are installed by typing "make installman".
42
43CONFIGURING:
44
45Before running httpd it must be configured. The name of the default
46configuration file is /etc/httpd.conf or you may pass the configuration
47file name to httpd. Upon starting up, httpd will parse the configuration
48file and then process requests. This README file and the sample httpd.conf
49may also help in configuring. The httpd.conf.5 man page presents the same
50information for reference use.
51
52
53The configuration file is an ascii file which consists of lines of the
54following form:
55
56directive LWS [parameters separated by LWS]
57
58NOTE: LWS denotes Linear White Space which is spaces and/or tabs
59
60The following are valid configuration file directives:
61 serverroot user chroot logfile dbgfile dirsend direxec vhost auth
62 proxyauth vpath include mtype
63
64To make the file more readable, on directives which occupy multiple
65lines you may omit the directive on lines after the first and begin
66these lines with LWS.
67
68
69serverroot path
70
71The serverroot directive sets the translation for // to the given path.
72
73
74user username
75
76The user directive causes the server to run as the given username, otherwise
77the server will run as whoever started it (normally root).
78
79
80chroot directory
81
82The chroot directive causes the server to chroot to the given directory after
83the configuration and log files have been opened. Normally this will be the
84home directory of the given username in the user directive.
85NOTE: /~user will be translated to the home directory of the given user
86 // will be translated to the serverroot directory
87NOTE: if this directive is used then beware of the consequences.
88
89
90logfile filename
91
92The logfile directive tells the server where to log http transactions.
93NOTE: the file must exist to enable logging
94
95
96dbgfile filename
97
98The dbgfile directive tells the server where to log debug http transactions.
99NOTE: the file must exist to enable logging
100
101dirsend filelist
102
103The dirsend directive tells the server that when a directory is requested
104that it should send the first file that it finds in the directory from the
105filelist for the request.
106
107
108direxec program
109
110The direxec directive tells the server that when a directory is requested
111and no file is found from the dirsend directive that it should run the
112given program.
113NOTE: the program normally generates a directory listing on the fly
114NOTE: the program access is considered X with no access restrictions.
115
116
117vhost hostname VhostRoot
118
119vhost is for defining access for virtual hosts. If none are configured then
120any host is accepted. If specified then access is only granted for requests
121for hosts which are configured here. In the Vpath section below the /// gets
122translated to the corresponding VhostRoot.
123
124
125auth authname authdescription access [passwdfile [users]]
126
127The auth directive sets up different authorizations with the server. The
128authname is the name given to the authorization and is case insensitive.
129The authdescription is the description of the authorization and is what
130the user will see when asked to enter a username and password. The
131access is one or more of (rwx). R tells the server the url can be
132read. W tells the server the url can be overwritten. X tells the server
133that the url can and should be executed. Access is in addition to normal
134unix security considerations. For instance a file that can be written to
135that does not have the W access will have an error returned. The
136passwdfile is the name of the passwdfile to validate users against. If
137the passwdfile is given as '.' then the system password file will be used
138which is /etc/passwd. If no passwdfile is given then no authorization is
139allowed for anyone. If no users are given then any validated users is
140authorized, otherwise only the given users are allowed.
141
142
143proxyauth authname authdescription access [passwdfile [users]]
144
145proxyauth defines any access authorization to be used for Proxy access
146authname = Same as auth above
147authdescription = Same as auth above
148access = Must be R to allow proxy
149passwdfile = Same as auth above
150users = Same as auth above
151
152
153vpath from to [auth [access]]
154
155The vpath directive sets up url path translations and authorizations. A
156requested url that matches from will be translated to to with the given
157auth and access. If auth does not exist then the url will have no access.
158If access is not given then the access is taken from the auth record (see
159above). A '.' in place of the to means that the server should use a
160translation from another vpath record, but associate the given auth and
161access with the requested url. A '*' maybe at the end only of the from
162which is a wildcard match. For example if the from has /AB* then any of
163/ABCDEF or /AB or /ABmichael will match, but /AD or /a will not. The
164requested url is first checked against each vpath record until an exact
165match (meaning url match from and from had no '*') is found or the end of
166the list. Therefore a wildcard match will match the last from is the list
167in which it matched.
168NOTE: if at the beginning of the to field
169 /~user will get translated to the home directory of the given user
170 // wile get translated to the serverroot directory
171
172
173include filename
174
175The include directive tells the server to read configuration information
176from the given filename.
177NOTE: normally mtype directives are included from another file
178
179
180mtype mimetype extensions
181
182The mtype directive tells the server what mimetype to associate with files
183which have any of the given extensions. If no match is found then the file
184will be treated as application/octet-stream.
185NOTE: normally you get mtype directives in included file
186
187
188
189USAGE:
190
191 httpd [-v|-t] [configuration-file]
192
193The -t tells the server to just parse the configuration file so that you
194can test it to see if it is the way you want it. You may also pass the
195name of your configuration file if it is not the default /etc/httpd.conf.
196
197The -v option prints the server version and then exits.
198
199
200STARTING:
201
202First of all httpd is a server and therefore you will need to start it
203with tcpd. Tcpd is a program which listens for incoming TCP connections
204on the passed port and when a connection comes in it forks and starts the
205given daemon program. Therefore to start httpd you use:
206
207 tcpd http /usr/local/bin/in.httpd &
208
209You will more than likely have this line in your /etc/rc or /etc/rc.net
210file so that whenever your system is restarted the web server will also
211be started. The first parameter http is the port that tcpd is going
212to be listening for connections on. Here http (which should be defined
213in /etc/services as 80) is the standard port for a web server. The second
214parameter is the program that tcpd will fork and exec when a connection
215comes in. The program will then have its stdin and stderr connected to
216the client Then the web server program will start running with the tcpd
217program waiting for the next connection. Currently there is no ability to
218limit the number of simultaneous web servers running. NOTE: At some point
219I will be adding the ability for httpd to start itself without the need of
220tcpd. That way httpd will already be in memory and have parsed its
221configuration file.
222
223In Minix 2.0.3 and later versions you may use:
224
225 daemonize tcpd http /usr/local/bin/in.httpd
226
227(daemonize is a shell function defined in /usr/etc/rc which starts programs
228as daemons).
229
230
231FINAL WORDS
232
233I wanted to get the server out as soon as possible so I hurried up and
234created this document to help out. Hopefully it will HELP more than
235it HURTS. If anyone is interested in writing man pages for httpd or any
236of the other network programs please let me know.
237
238
239Michael Temari
240Michael@TemWare.Com
241
242Please note also the SECURITY document in this directory. (asw 2003-07-05)
Note: See TracBrowser for help on using the repository browser.