Centos – Installing Apache MPM Worker on Centos 5.5

apache-2.2centos

I have a CentOS 5.5. server and am trying to switch from MPM Prefork to MPM worker.
I have the standard yum httpd packages installed currently and from my reading I did the following:

  • Uncomment the httpd.worker line in the /etc/sysconfig/httpd file.
  • I also made sure that the httpd.worker file exists in the /usr/sbin/ directory.
  • I also made sure that httpd service is stopped before making the above change.
  • Ensured PHP was disabled for Apache. I'm fine with this and will use FastCGI to handle PHP files once I get the MPM worker up and running.

  • Restart the httpd service, everything starts fine.

  • Do a # httpd -V
  • The console tells me it's still using prefork.

If I do a # vi /etc/init.d/httpd the httpd.worker line is still commented out. I've tried changed this as well to no difference.

Any suggestions? Things to look at? My application requires the worker MPM so the only choice I can think of is to go with ubuntu or another flavor that has the dedicated apache2-mpm-worker package. Is there something similar in the yum repos somewhere?

Thanks in advance!

Best Answer

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