Posts

List of commonly used Apache directives


This article describes the basic configuration items for Apache.


Apache configuration files


Apache configuration files have different file names and installation locations depending on the operating system.

CentOS・RHEL・Fedora

/etc/httpd/conf/

SUSE・Debian・MacOS​

/etc/apache2/

Installation location

​/usr/local/apache2/conf/

The configuration files can likely be found in each of the directories above. If not, you can find it by using the find command.


Apache Directives

Directives are used to give instructions, specifications, etc. to a program.

Settings can be added or edited by writing special instructions in the file.

When building a server, directives to be modified include


Directive name

Configuration details

Timeout

Number of seconds from receipt of a request to completion of processing

KeepAlive

Enable/disable multiple request processing for a single TCP connection

​MaxKeepAliveRequests

​Maximum number of requests per TCP connection when KeepAlive is enabled

​KeepAliveTimeout

Maximum latency for a single TCP connection when KeepAlive is enabled

Options

Configure available functions for directories

Directives regarding processes launched by other Apache processes are listed below.

​Directive name

​Configuration details

StartServers

Number of child processes spawned at startup

​MinSpareServers

Minimum number of child processes to wait

MaxSpareServers

Maximum number of child processes to wait

MaxClients

Upper limits number of child processes to be created

​MaxRequestsPerChild

​Number of requests that the child process can handle

The settings for child processes should be checked when the server load is high.


The load can also be reduced by changing the value by considering Web access conditions and server processing performance.



This blog post is translated from a blog post written on our Japanese website

Beyond Co.