Ari Luotonen, CERN, May 1994

Installing CERN Server

VMS note: There are special instructions if you are installing under VMS.


Getting the Program

CERN server distribution is available from info.cern.ch anonymous ftp account. 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.

Configuration File

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 /Public/Web and accepts them.

The default welcome document (what you get with URL of form http://your.host/) is now Welcome.html in the directory /Public/Web.


First Trying It Out In Verbose Mode

Often it is easy to make mistakes in the configuration file that makes configuring 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; e.g.

        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 port 8080.

You can now try to request a document form your server using a URL of form:

        http://your.host:8080/document.html
where 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 self-explanatory.

And remember, you should always feel free to ask advice from httpd@info.cern.ch.


The Actual Installation of httpd

In Unix you can run the server either as stand-alone, or from Internet Daemon (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 inetd spawn httpd every time a request comes. We therefore recommend that you run CERN httpd in stand-alone mode.

Stand-alone Installation

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.local or /etc/rc). If you have the configuration file in the default place, /etc/httpd.conf, and if it specifies the port to listen to via the Port directive, you don't need any command line options:

    /usr/etc/httpd &
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.


Registering Your Server

Once you have your httpd up and running, and you have documents to show the word, announce your server, so that others can find it.


If It Doesn't Work...

...first run it in verbose mode with the -v option and try to figure out what goes wrong. See also the debugging chart and the FAQ. If you can't figure out what's going wrong, feel free to send mail to httpd@info.cern.ch


httpd@info.cern.ch