How can I change from prefork to worker MPM on CentOS 64bit?

Solution 1:

Edit: /etc/sysconfig/httpd

Uncomment:

HTTPD=/usr/sbin/httpd.worker

Restart, voila!

Solution 2:

CentOS 6x:

modify file: /etc/sysconfig/httpd

HTTPD=/usr/sbin/httpd.worker

CentOS 7x:

$ cat /etc/httpd/conf.modules.d/00-mpm.conf

    #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

Restart


Solution 3:

Edited: /etc/sysconfig/httpd

And uncommented:

HTTPD=/usr/sbin/httpd.worker

After restarting httpd (service httpd restart) I get the following error:

Stopping httpd:                                            [  OK  ]
Starting httpd: httpd.worker: Syntax error on line 222 of /etc/httpd/conf/httpd.conf: Syntax error on line 9 of /etc/httpd/conf.d/php.conf: Cannot load /etc/httpd/modules/libphp5-zts.so into server: /etc/httpd/modules/libphp5-zts.so: cannot open shared object file: No such file or directory
                                                           [FAILED]

You might need to install php-zts though.

yum install php-zts

After that no more error messages and httpd is starting normally with module worker active.