-->
Previous Table of Contents Next


Compiling the Web Software

If you don’t have to modify the source and recompile for Linux (because your software is the Linux version), you can skip the configuration details mentioned in the rest of this section. On the other hand, you may want to know what is happening in the source code anyway because you can better understand how Linux works with the Web server code. If you obtained a generic, untailored version of the NCSA Web server, you have to configure the software.

Begin by editing the src/Makefile file to specify your platform. There are several variables that you have to check for proper information:

AUX_CFLAGS Uncomment the entry for Linux (identified by comment lines and symbols, usually).
CC The name of the C compiler (usually cc or gcc).
EXTRA_LIBS Add any extra libraries that need to be linked in (none are required for Linux).
FLAGS Add any flags you need for linking (none are required for most Linux linkers).

Finally, look for the CFLAGS variable. Some of the values for CFLAGS may be set already. The following are valid values for CFLAGS:

-DSECURE_LOGS Prevents CGI scripts from interfering with any log files written by the server software.
-DMAXIMUM_DNS Provides a more secure resolution system at the cost of performance.
-DMINIMAL_DNS Doesn’t allow reverse name resolution, but speeds up performance.
-DNO_PASS Prevents multiple children from being spawned.
-DPEM_AUTH Enables PEM/PGP authentication schemes.
-DXBITHACK Provides a service check on the execute bit of an HTML file.
-O2 Optimizing flag.

It is unlikely that you will need to change any of the flags in the CFLAGS section, but at least you now know what they do. Once you have checked the src/Makefile for its contents, you can compile the server software. Issue the command:


make linux

If you see error messages, check the configuration file carefully. The most common problem is the wrong platform (or multiple platforms) selected in the file.

Configuring the Web Software

Once the software is in the proper directories and compiled for your platform, it’s time to configure the system. Begin with the httpd.conf-dist file. Copy it to the filename httpd.conf, which is what the server software looks for. This file handles the httpd server daemon. Before you edit the file, you have to decide whether you will install the Web server software to run as a daemon or whether it will be started by inetd. If you anticipate frequent use, run the software as a daemon. For occasional use, either is acceptable.

There are several variables in httpd.conf that need to be checked or have values entered for them. All the variables in the configuration file follow the syntax:


variable value

with no equal sign or special symbol between the variable name and the value assigned to it. For example, a few lines would look like this:


FancyIndexing on

HeaderName Header

ReadmeName README

Where pathnames or filenames are supplied, they are usually relative to the Web server directory, unless explicitly declared as a full pathname. You need to supply the following variables in httpd.conf:

AccessConfig The location of the access.conf configuration file. The default value is conf/access.conf. You can use either absolute or relative pathnames.
AgentLog The log file to record details of the type and version of browser used to access your server. The default value is logs/agent_log.
ErrorLog The name of the file to record errors. The default is /logs/error_log.
Group The Group ID the server should run as (used only when server is running as a daemon). Can be either a group name or group ID number. If a number, it must be preceded by #. The default is #-1.
MaxServers The maximum number of children allowed.
PidFile The file where you want to record the process ID of each httpd copy. The default is /logs/httpd.pid. Used only when the server is in daemon mode.
Port Port number httpd should listen to for clients. Default port is 80. If you don’t want the Web server generally available, choose another number.
ResourceConfig The path to the srm.conf file, usually conf/srm.conf.
ServerAdmin Email address of the administrator.
ServerName The fully qualified host name of the server.
ServerRoot The path above which users cannot move (usually the Web server top directory or usr/local/etc/httpd).
ServerType Either standalone (daemon) or inetd.
StartServers The number of server processes that are started when the daemon executes.
TimeOut The amount of time in seconds to wait for a client request, after which it is disconnected (default is 1,800, which should be reduced).
TransferLog The path to the location of the access log. Default is logs/access_log.
TypesConfig The path to the location of the MIME configuration file. Default is conf/mime.conf.
User Defines the user ID the server should run as (only valid if running as a daemon). Can be name or number but must be preceded by # if a number. Default is #-1.


Previous Table of Contents Next