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:
If I switch the /etc/sysconfig/httpd back to the default, the ps output is like this:
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