0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

apacheの子プロセスとServerTokensについて

Posted at

apacheのhttpd.confの子プロセスとServerTokensの設定内容ついて、
(簡単なWEBサーバであれば)あまりデフォルトから変更することはないが
備忘で残します。

まずは基本的に

  • CPUのコアは2以上にするべき。
    • Hyper-Vでサーバ起動するとデフォルトのCPUコアが1なので注意。
    • アパッチがマルチスレッディングだからマルチコアが必要。

子プロセスの設定

  • apacheのforkとworkerとは子プロセスの定義である。
    • apacheのforkは子プロセスで1接続処理できる。
StartServers       8 #親が起動した時点で起動される子プロセス数
MinSpareServers    5 #httpdがアイドル状態で待機させる数。
MaxSpareServers   20 #親プロセスがアイドルになった時、子プロセスを削除する下限値。
ServerLimit      256 #MaxClientsの設定できる上限。
MaxClients       256 #子プロセスの最大数。これ超える処理はできない。
MaxRequestsPerChild  4000 #1つ子プロセスが処理できるリクエストの数。
  • アパッチのworkerとは、子プロセスでn接続処理できる。

ServerTokensの設定

  • クライアントに送り返す Server 応答ヘッダ内に、サーバの一般的な OS 種別や、 コンパイルされて組み込まれているモジュールの情報を 含めるかどうかを指定。
  • ざっくり言うと、httpヘッダーやエラー画面に出る情報。
    • ブラウザのinternalError時の画面下に出る「Server:ApacheServer/2.0.41(CentOS)」みたいなやつ。
    • セキュリティ的には「Prod」にした方が良いかと考えられる。

ServerTokens Prod

  • 表示: Server:Apache

ServerTokens Major

  • 表示: Server: Apache/2

ServerTokens Minor

  • 表示: Server: Apache/2.0

ServerTokens Min[imal

  • 表示: Server: Apache/2.0.41

ServerTokens OS

  • 表示: Server: Apache/2.0.41 (Unix)

ServerTokens Full (もしくは未指定)

  • 表示: Server: Apache/2.0.41 (Unix) PHP/4.2.2 MyMod/1.2

以上。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?