https://end0tknr.hateblo.jp/entry/20170814/1502686286
上記urlのentryにあるように、 以前から apacheのmpmには prefork を 使用してきましたが、eventに変更。
apache の mpm = {prefork , worker , event} については 次のurlが分かりやすいです。
https://milestone-of-se.nesuke.com/sv-basic/linux-basic/apache-mpm-prefork-worker-event/
apache httpd の install
srcからのinstallの場合、手順は以下の通り、 configureに「--enable-mpms-shared=all」を付与するだけです。
$ tar -xvf httpd-2.4.27.tar.gz
$ cd httpd-2.4.27/srclib
$ wget http://ftp.kddilabs.jp/infosystems/apache/apr/apr-1.6.2.tar.gz
$ tar -zxvf apr-1.6.2.tar.gz
$ mv apr-1.6.2 apr
$ wget http://ftp.kddilabs.jp/infosystems/apache/apr/apr-util-1.6.0.tar.gz
$ tar -zxvf apr-util-1.6.0.tar.gz
$ mv apr-util-1.6.0 apr-util
$ cd ..
$ ./configure --prefix=/sing/local/httpd \
--enable-mpms-shared=all \
--enable-proxy \
--enable-modules=all \
--enable-so
:
configure: summary of build options:
Server Version: 2.4.27
Install prefix: /home/endo/local/apache24
C compiler: gcc -std=gnu99
CFLAGS: -g -O2 -pthread
LDFLAGS:
LIBS:
CPPFLAGS: -DLINUX -D_REENTRANT -D_GNU_SOURCE
C preprocessor: gcc -E
$ make
$ make install
apache httpd の 設定 (httpd.conf)
--enable-mpms-shared=all により httpd.conf に mpm????module が選択できるようになる為、コメントアウト/イン で 切り替えることができます。
LoadModule mpm_event_module modules/mod_mpm_event.so #LoadModule mpm_prefork_module modules/mod_mpm_prefork.so #LoadModule mpm_worker_module modules/mod_mpm_worker.so #Include conf/extra/httpd-mpm.conf
apache httpd の 確認
httpd -V を実行することで、Server MPM を確認できます
$ httpd/bin/httpd -V
Server version: Apache/2.4.41 (Unix)
Server built: Dec 10 2019 06:19:06
Server's Module Magic Number: 20120211:88
Server loaded: APR 1.7.0, APR-UTIL 1.6.1
Compiled using: APR 1.7.0, APR-UTIL 1.6.1
Architecture: 64-bit
Server MPM: event #### ココ
threaded: yes (fixed thread count)
forked: yes (variable process count)
Server compiled with....
: