Change apache MPM prefork to worker on Amazon Linux AMI – Problems with loading a website are often blamed on the Internet connection, but even the most perfectly set up network cannot help if there is no service to reply at your destination. One of the most popular HTTP servers used for this task is Apache2. Much of Apache’s popularity can be attributed to its easy installation and use, but never the less it is possible to run into problems with even the easiest of the software. If you’ve encountered an issue loading your web page, follow these simple troubleshooting methods outlined in this guide to attempt to get your web server back up and working again. Below are some tips in manage your apache2 server when you find problem about apache-2.2, amazon-ec2, mod-wsgi, , .
My project by default is running under Prefork MPM. Rigth now i am having some slowing issues, my web got timeout error. Searching on differents foroums i see that is recomended to use the worker module and i see differents ways to changed it but in the end nothing working with my project.
I run my project under apache2.2 with this script
python manage.py runmodwsgi –setup-only –host=0.0.0.0 –port=8000 –reload-on-changes –server-root=/mod_wsgi/
This script create my apachectl in the folder “mod_wsgi”
Inside the folder i use “./apachectl -V” to see the module that is working in the project and is see this
Server version: Apache/2.2.34 (Unix)
Server built: Nov 1 2017 18:47:16
Server’s Module Magic Number: 20051115:43
Server loaded: APR 1.5.1, APR-Util 1.4.1
Compiled using: APR 1.5.1, APR-Util 1.4.1
Server MPM: Prefork
forked: yes (variable process count)
Server compiled with….
So, to change it from prefork MPM to Worker i tried was uncomment line:
in the file in this path /etc/sysconfig/httpd, then i restart and run it again, but didnt changed it.
Other thing that i saw in the web was change the file /etc/httpd/conf.modules.d/00-mpm.conf but this path doesnt exitst in my instance.
Also i tried to run my initial script with this aditional flag ./configure –with-mpm=worker but seems that is not working.
Aditional, and is a thing that im not complety sure why happend, if i put just “apachectl -V” without “./” i see that the MPM changed to worker but not in my apachectl from my mod_wsgi folder.
Some advice to change the MPM of my project?
Thanks in advance.
‘Restart’ is ambiguous (will likely translate to apachectl graceful or equivalent). When changing MPM be sure to stop then start.