On my system I just edited the /etc/sysconfig/httpd file to enable the httpd.worker.
After restarting httpd, I ran "ps -ef | grep -i http" and got this:
[root@localhost httpd]# ps -ef | grep -i http
root 16334 17289 0 10:44 pts/1 00:00:00 grep -i http
root 30536 1 0 10:00 ? 00:00:00 /usr/sbin/httpd.worker
apache 30539 30536 0 10:00 ? 00:00:00 /usr/sbin/httpd.worker
apache 30541 30536 0 10:00 ? 00:00:02 /usr/sbin/httpd.worker
[root@localhost httpd]#
If I switch the /etc/sysconfig/httpd back to the default, the ps output is like this:
[root@localhost httpd]# ps -ef | grep -i http
root 16447 1 0 10:47 ? 00:00:00 /usr/sbin/httpd
apache 16448 16447 0 10:47 ? 00:00:00 /usr/sbin/httpd
apache 16449 16447 0 10:47 ? 00:00:00 /usr/sbin/httpd
apache 16450 16447 0 10:47 ? 00:00:00 /usr/sbin/httpd
apache 16451 16447 0 10:47 ? 00:00:00 /usr/sbin/httpd
apache 16453 16447 0 10:47 ? 00:00:00 /usr/sbin/httpd
apache 16454 16447 0 10:47 ? 00:00:00 /usr/sbin/httpd
apache 16455 16447 0 10:47 ? 00:00:00 /usr/sbin/httpd
apache 16456 16447 0 10:47 ? 00:00:00 /usr/sbin/httpd
root 16458 17289 0 10:47 pts/1 00:00:00 grep -i http
[root@localhost httpd]#
And in this case the "httpd -V" output is the same as before.
Since the number of running processes matches my configuration options for the prefork and worker modules set in the "/etc/httpd/conf/httpd.conf" I believe it's working as advertised.
I suspect the "httpd -V" is reporting the compiled in defaults.
because: server binary names are different.
httpd (prefork,default) != httpd.worker (non-default)
Dan
Best Answer
It depends on whether you have a worker MPM httpd binary compiled or not. Some distributions come with several binaries (named
httpd.worker
or such like) and you just change your start-up script to point at the desired binary.On the other hand you may have to compile Apache yourself with the desired MPM.