This section describes how to install W3C httpd.
Often you don't need to compile the server yourself, precompiled binaries are available for many Unix platforms. If there is no precompiled version for your platform, of if it doesn't work (e.g. the name resolution doesn't work), you should get the source code and compile it yourself. There is special instructions if you are installing under VMS.
uncompress w3c-httpd-3.0A.tar.Z tar xvf w3c-httpd-3.0A.tar.Z
WWWdirectory then it is very important that you do the following:
cd WWW make clobber make
in order to make sure that all new code is built. If not then go to newly-created
WWW directory, and give command the
cd WWW make
httpdappears in directory
../WWW/Daemon/sun4(if you have a Sun4 machine), or in another subdirectory corresponding to your machine architecture. The utility programs go to the same directory (
httpdrequires a configuration file, the default configuration file is
/etc/httpd.conf. If this doesn't suit you, you can specify another location to it using the
httpd -r /other/place/httpd.conf
cern_httpd/configinside the binary distribution, or
WWW/server_rootinside the source code distribution.
If you have all your documents in a single directory tree, say
/Public/Web, the easiest way to make them available to the world
is to specify the following rule in your configuration file:
Pass /* /Public/Web/*
This maps all the requests under the directory
The default welcome document (what you get with URL of form
http://your.host/) is now
Welcome.html in the directory
Often it is easy to make mistakes in the configuration file that makes
httpd feel tedious - this doesn't have to be so.
In the beginning start
httpd by hand in verbose mode to listen
to some port, and look what happens when you make a request to that port
with your browser.
Typically test servers are run on a non-priviledged port above 1024 (you
don't have to be
root to bind to them), often 8001, 8080, or
such. Official HTTP port is 80.
The server port is defined in the configuration file with the
Port directive, but
you can override it with the
-p command line option while testing;
httpd -v -r /home/you/httpd.conf -p 8080
This will start
httpd in verbose mode, use configuration file
httpd.conf in your home directory, and accept connections to
You can now try to request a document from your server using a URL of form:
document.html is relative to the directory that you have
exported in your configuration file. If you get an error message back see
the verbose output to find out what is going wrong - it is usually
In Unix you can run the server either as stand-alone, or from
(inetd). A stand-alone
server is typically started once at system-boot time. It waits for incoming
connections, and forks itself to serve a request. This is much
faster than letting
every time a request comes.
We strongly recommend that you run W3C httpd in stand-alone mode.
A stand-alone server is started from the bootstrap command file (for example
/etc/rc.local) so that it runs continuously like the
sendmail daemon, for example.
This method has the advantage over using the
inetd that the
response time is reduced.
Add a line starting
httpd to your system startup file (usually
/etc/rc). If you have the
configuration file in the default place,
if it specifies the port to listen to via the
you don't need any command line options:
httpd will automatically go background so there is really no
need for an ampersand in the end (as long as your configuration file
/etc/httpd.conf really exists).
Or a little more safely in case httpd is removed:
if [ -f /usr/etc/httpd ]; then (/usr/etc/httpd && (echo -n ' httpd') ) & >/dev/console fi
Naturally you can use any of the command line options, if necessary.
Once you have your
httpd up and running, and you have documents
to show the world,
announce your server, so that others can find it.
...first run it in verbose mode with the
-v option and try
to figure out what goes wrong. See also the
debugging chart, the
FAQ, and the Known Bugs
pages. If you can't figure out what's going wrong, feel free to send mail
@(#) $Id: Installation.html,v 1.14 1998/08/11 13:43:20 connolly Exp $