+1 vote
in Operating Systems by (73.6k points)
edited by

I have installed Hestia Control Panel on my VPS. One of my VPS has Ubuntu 20 and another has Debian 10. On both OS, hestiacp has enabled MPM_prefork by default. I want to switch to MPM_event. How can I change the Apache mpm?

1 Answer

+1 vote
by (355k points)
selected by
 
Best answer

To change the Apache MPM on Ubuntu/Debian, run the following commands in the given sequence on the terminal as "root":

  • The default PHP in the new hestiacp is 7.3. Disable it because it gives an error with mpm_event.

# a2dismod php7.3

  • Disable mpm_prefork.

# a2dismod mpm_prefork

  • Enable mpm_event.

# a2enmod mpm_event

  • Restart the Apache server. If you have the latest hestiacp, you must have Nginx and PHP-FPM. Restart them too.

# systemctl restart php7.3-fpm.service
# systemctl restart nginx.service 

# systemctl restart apache2.service

MPM_event should be active now. Check the Apache MPM using the following command:

# apachectl -V

or

# a2query -M

Troubleshooting: After switching to mpm_event, if your webpages don't open and you get 500 error ( Internal Server Error), it may be possible that you have both mod_fcgid and mod_ruid2 enabled. To check enabled Apache modules, run the following command:

# ls -l /etc/apache2/mods-enabled/

With mpm_event, the mod_fcgid is not compatible with mod_ruid2, so you need to disable mod_ruid2. Run the following command to disable mod_ruid2 and then restart PHP-FPM, Nginx, and Apache. It should fix the error.

# a2dismod ruid2


...