List of commonly used Apache directives

table of contents
This is Nakagawa from the Systems Solutions Department.
currentlythe LPIC 202 examstudying for
In particular, I'm enthusiastically working on the basic Apache configuration included in "Subject 208: HTTP Services,"
as this is relevant when building servers and troubleshooting.
I've compiled a summary of the Apache configuration items (directives) that I frequently encounter.
・Apache configuration file
The file name and installation location of the Apache configuration file vary depending on the OS
| CentOS, RHEL, Fedora | /etc/httpd/conf/ |
|---|---|
| SUSE, Debian, MacOS | /etc/apache2/ |
| sauce | /usr/local/apache2/conf/ |
The directories mentioned here are merely those that are highly likely to contain configuration files, so
if you can't find them, try searching using the `find` command or similar.
・Apache directives
A directiveis used to give instructions or specifications to a program.
You can add and edit settings by writing specific commands within a file.
The directives you might modify when building a server include the following:
| Directive Name | Setting details |
|---|---|
| Timeout | The number of seconds it takes for a request to be processed |
| KeepAlive | Enable/disable handling of multiple requests over one TCP connection |
| MaxKeepAliveRequests | Maximum number of requests per TCP connection when KeepAlive is enabled |
| KeepAliveTimeout | Maximum waiting time for one TCP connection when KeepAlive is enabled |
| Options | Configure available features for a directory |
The directives for Apache child processes (processes launched by other processes) are as follows:
| Directive Name | Setting details |
|---|---|
| StartServers | Number of child processes to create at startup |
| MinSpareServers | The minimum number of waiting child processes |
| MaxSpareServers | Maximum number of waiting child processes |
| MaxClients | Limit on spawned child processes |
| MaxRequestsPerChild | Number of requests a child process can handle |
The settings for child processes (processes launched by other processes) can be checked when the server load is high, and
by adjusting the values considering Apache's access status and the server's processing performance, the load can be reduced.
lastly
Now in my second year at the company, when dealing with daily alerts on various web servers, I
can often pinpoint the cause based on my past experience, but
I feel that I am still lacking in terms of identifying the root cause and finding measures to prevent recurrence.
after understanding the load, basic performance, and configuration status of each server
I compiled this information with the hope that it would serve as a starting point for taking fundamental measures
This time we only picked out a limited number of Apache directives, but
next time we'll look into middleware other than Apache.
1
