0

I'm using a VPS running Apache2.4 and CentOS7. I'm hitting some threading issues and would like to try to run Apache in prefork mode.

If I run apachectl -V to check which mode I'm in, I get this result:

Server MPM:     worker
  threaded:     yes (fixed thread count)
    forked:     yes (variable process count)

However when I check the MPM conf (/etc/httpd/conf.modules.d/00-mpm.conf), I see that the prefork module has been loaded:

#HTTPD=/usr/sbin/httpd.worker
#OPTIONS=
HTTPD_LANG=C
#PIDFILE=/var/run/httpd/httpd.pid

# Select the MPM module which should be used by uncommenting exactly
# one of the following LoadModule lines:
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
#LoadModule mpm_worker_module modules/mod_mpm_worker.so
#LoadModule mpm_event_module modules/mod_mpm_event.so

And further if I check /etc/sysconfig/httpd I see the the worker line is commented out:

#HTTPD=/usr/sbin/httpd.worker
#OPTIONS=
HTTPD_LANG=C
#PIDFILE=/var/run/httpd/httpd.pid

I've checked that this configuration is actually applied to the instance of Apache that I'm using. For example the pattern /etc/httpd/conf.modules.d/*.conf is Included into my httpd.conf file. Is it likely these options are being overwritten somewhere, or am I missing something? Thanks!

1 Answers1

0

I found the issue; There was another conf file /etc/apache2/conf.modules.d/000_mod_mpm_worker.conf which loads mpm_worker_module. I tried to uncomment the LoadModule line in this file, but then I got an error from Apache on restart telling me that no MPM module is loaded. The final solution was to change this file to 000_mod_mpm_prefork.conf and load mpm_prefork_module inside it.