Apache Perl Compilation Failed Errors

From Integrics Wiki
Jump to: navigation, search

Recent Debian based Linux distributions (Ubuntu 14.04 for example) seem to have a problem with Apache giving Perl compilation failed errors regularly, like this:

[Sat May 07 05:26:38.103991 2016] [:error] [pid 9574:tid 139987194402560] [Sat May  7 05:26:38 2016] -e: [Sat May  7 05:26:38 2016] JSON.pm: Attempt to reload Integrics/Enswitch/APIUtils.pm aborted.\n[Sat May  7 05:26:38 2016] -e: [Sat May  7 05:26:38 2016] JSON.pm: Compilation failed in require at /usr/local/lib/site_perl/Integrics/Enswitch/JSON.pm line 11.\n[Sat May  7 05:26:38 2016] -e: Compilation failed in require at /usr/local/lib/site_perl/Integrics/Enswitch/Utils.pm line 55.\n

It is believed this is due to the default mpm_event worker module that is shipped. The solution is to change to mpm_prefork as follows:

apt-get install apache2-mpm-prefork # not required on Debian 9 and above
a2dismod mpm_event
a2enmod mpm_prefork
Edit /etc/apache2/mods-enabled/mpm_prefork.conf and set MaxConnectionsPerChild to 1000.
service apache2 restart