Search code examples
apachedebianhttp2

ERR_EMPTY_RESPONSE when active mpm_event


I try to activate mpm_eventon my Apache (OS Debian 9 ) and disable mpm_prefork for active http/2 on my site.
But When I do that, my site goes down and shows ERR_EMPTY_RESPONSE on the browser.

The following commands I used to do that:

sudo apt-get install php7.4-fpm
sudo a2enmod proxy_fcgi
sudo a2dismod php7.4
sudo a2enconf php7.4-fpm
sudo a2dismod mpm_prefork
sudo a2enmod mpm_event
sudo service apache2 restart

In the apache log I see just this error:

AH00052: child pid 27520 exit signal Aborted (6)

Is there anyone who knows what should I do to fix that?


Solution

  • I found out that the problem is because of Mod_Ruid2 conflicts with PHP_fpm.

    When I disabled Mod_Ruid2 the site was back up and running without any problems.

    a2dismod ruid2
    

    The purpose of mod_ruid2 is to allow run of scripts with the users permission when Apache is using mod_php. In that mode Apache is ran with root and child processes are being setuid-ed to the proper user so they can't touch other user files.

    The php-fpm is completely different approach. With php-fpm the apache does not compile php scripts - everything is done by external binary (called php-fpm). Therefore there is absolutely no need for mod_ruid2 when you are using php-fpm.

    https://forum.directadmin.com/threads/php-fpm-and-mod_ruid2-with-php7-1.56552/

    https://forum.vestacp.com/viewtopic.php?t=16041