[Osaka/Yokohama] Looking for infrastructure/server side engineers!

[Osaka/Yokohama] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

よく利用するapacheのディレクティブ一覧

システムソリューション部の中川です。
現在LPIC202試験の勉強に取り組んでいます。
なかでも、「主題208:HTTPサービス」に含まれるApacheの基本的な設定については
サーバ構築や障害対応時に関わってくる内容のため、意欲的に取り組んでます。
そのうち、よく触れるapacheの設定項目(ディレクティブ)についてまとめました。

・apacheの設定ファイル

apacheの設定ファイルは、OSによってファイル名やインストール先が異なります。

CentOS・RHEL・Fedora /etc/httpd/conf/
SUSE・Debian・MacOS /etc/apache2/
ソース /usr/local/apache2/conf/

ここで紹介した各ディレクトリは、あくまで設定ファイルを置いている可能性が高いだけですので
もし見つからなければfindコマンド等を使って検索してみてください。

・apacheの各ディレクティブ

ディレクティブというのは、プログラムに指示や指定などを与えるためのものです。
ファイル内に専用の命令を記述することで設定を追記・編集できます。
サーバ構築時に、修正するディレクティブには次のものがあります。

ディレクティブ名 設定内容
Timeout リクエストを受け取ってから処理が終わるまでの秒数
KeepAlive 1つのTCP接続における複数リクエスト処理の有効化・無効化
MaxKeepAliveRequests KeepAlive有効時、1つのTCP接続での最大リクエスト数
KeepAliveTimeout KeepAlive有効時、1つのTCP接続での最大待ち時間
Options ディレクトリに対して使用可能な機能を設定する

apacheの子プロセス(他プロセスにて起動したプロセス)に関するディレクティブは次のとおりです。

ディレクティブ名 設定内容
StartServers 起動時に生成する子プロセス数
MinSpareServers 待機させる子プロセスの最小数
MaxSpareServers 待機させる子プロセスの最大数
MaxClients 生成される子プロセスの上限
MaxRequestsPerChild 子プロセスが処理できるリクエスト数

子プロセス(他プロセスにて起動したプロセス)に関する設定値は、サーバ負荷が高い時に確認したり
apacheのアクセス状況とサーバの処理性能を考慮して、値を修正することで負荷を軽減出来たりします。

最後に

入社して2年目になり、各Webサーバ上での日々発生しているアラート対応をする際
原因調査はこれまでの経験からして当たりを付けることはできますが
根本的な原因究明や、再発防止策を探すという点では至らないと感じる点が多いです。

サーバ毎の負荷と基本性能、設定状況を理解したうえで
根本的な対応をするための足掛かりになればと思いまとめました。

今回はapacheの限られたディレクティブのみをピックアップしましたが
次はapache以外のミドルウェアについても調べてみます。

この記事がお役に立てば【 いいね 】のご協力をお願いいたします!
1
読み込み中...
1 票, 平均: 1.00 / 11
2,155
X facebook はてなブックマーク pocket
[2024.6.30 CentOS support ended] CentOS server migration solution

[2024.6.30 CentOS support ended] CentOS server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

The person who wrote this article

About the author

Sakina Nakagawa

I joined the company in 2016 as a new graduate. Lately, I've been having fun learning the basics of servers.