Debian: Fixing the ulimit 87 error

If you ever get an error message from your Debian 7.x (wheezy) system where apache2 complains about
/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted),
it helped me to explicitly set the ulimit config value for apache2 to the system’s maximum value. It seems as if wheezy fails to get the system default if the value is not explicitly set.

To do this,

  1. Determine the system’s current ulimit for file descriptors using the command ulimit -n (returned 1024 for me)
  2. Edit /etc/apache2/envvars and set this variable: APACHE_ULIMIT_MAX_FILES='ulimit -n 1024' (was commented out on my system)
  3. Try reloading apache2. The error message should no longer appear.

This might have side effects if you are on a busy system with massive virtual hosting, but in this case, you’ll know how to optimize system ulimits anyway :)

One comment Debian: Fixing the ulimit 87 error

Reiner says:


better solution: Put the higher value in the limiter file:
(direct: # cat /etc/security/limits.conf or in the subdirectory for separating)

# cat /etc/security/limits.d/www-data.conf
root hard nofile 8192
root soft nofile 8192
www-data hard nofile 8192
www-data soft nofile 8192


Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert