Apacheモジュールメモ

  • モジュール作成
apxs -g -n helloworld
cd helloworld
make
make install

/etc/httpd/conf.d/helloworld.conf を以下のように作成

LoadModule helloworld_module modules/mod_helloworld.so
<Location /helloworld>
SetHandler helloworld
</Location>

以下のようにした場合は、.hw で終わるファイルを指定すると、.hw はあってもなくても mod_helloworld が呼ばれる。

AddHandler helloworld   .hw
apachectl restart
Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c
1.3の場合は、
gdb /usr/sbin/httpd
b startup_children
run -X

2.0の場合は調べる。

4種類

  1. Serverプール: 各httpdプロセスに1つ
  2. Connectionプール: 各コネクション毎に1つ
  3. Requestプール: 各リクエスト&レスポンス毎に1つ。基本はこれ
  4. Subプール: