-->
Previous Table of Contents Next


BindAddress

At startup, Apache binds to the port that it’s specified to bind to for all IP numbers that the box has available. The BindAddress directive can be used to specify only a specific IP address to bind to. By using this specific address, you can run multiple copies of Apache, each serving different virtual hosts, rather than have one daemon handle all virtual hosts. This is useful if you want to run two Web servers with different system user IDs, for security and access control reasons.

Suppose that you have three IP addresses: 1.1.1.1, 1.1.1.2, and 1.1.1.3, with 1.1.1.1 being the primary address for the machine. You want to run three Web servers, but you want one of them to run as a different user ID than the other two. You’d have two sets of configuration files. The first configuration file would say something like this:


User web3

BindAddress 1.1.1.3

ServerName www.company3.com

DocumentRoot /www/company3/

The other configuration file would have the following:


User web1

ServerName www.company1.com

DocumentRoot /www/company1/

<VirtualHost 1.1.1.2>

ServerName www.company2.com

DocumentRoot /www/company2/

</VirtualHost>

If you launch the first, it will bind only to IP address 1.1.1.3. The second one, because it has no BindAddress directive, will bind to the port on all IP addresses. So you want to launch a server with the first set of configuration files, and then launch another copy of the server with the second set of configuration files. Two servers essentially would be running on the same machine.

PidFile

PidFile is the location of the file containing the process ID for Apache. This file is useful for being able to automate the shutdown or restart of the Web server. By default, this parameter is logs/httpd.pid. For example, you could shut down the server with this command:


cat /usr/local/etc/httpd/logs/httpd.pid | xargs kill -15

You might want to move this out of the logs directory and into a directory such as /var, but it’s not necessary.

Timeout

The Timeout directive specifies the amount of time that the server will wait between packets sent before considering the connection “lost.” For example, 1200 (the default) means that the server will wait for 20 minutes after sending a packet before it considers the connection dead if no response comes back. Busy servers may want to shorten the time, at the cost of reduced service to low-bandwidth customers.

From Here…

You can learn more about running the Apache Web server in the following chapters:

  Chapter 35, “Getting Started with Apache,” discusses the basics of installing and configuring the Apache Web server.
  Chapter 37, “Managing an Internet Web Server,” shows you how to make your server robust, efficient, automated, and secure.


Previous Table of Contents Next