Monatsarchiv für Juli 2013

Debian: Fixing the ulimit 87 error

Sonntag, den 28. Juli 2013

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 :)