Apache Error: Unable to open logs

Sometimes apache will fail to start. It will show the following error message in apache error logs:

Unable to open logs

This is because of the low number of file descriptors. Check the current limit of file descriptors in the file /proc/sys/fs/file-max:

$ cat /proc/sys/fs/file-max
1024

If fs.file-max is quite small (several thousands or so), it should be changed to a higher value.

$ echo “65535″ > /proc/sys/fs/file-max

If you want this new value to survive across reboots you can add it to /etc/sysctl.conf.

# Maximum number of open files permited
fs.file-max = 65535

To load new values from the sysctl.conf file:

$ sysctl -p /etc/sysctl.conf

Hint: Add `ulimit -n 65536` command to /etc/rc.d/init.d/httpd or /etc/init.d/httpd and /usr/sbin/apachectl apache startup scripts at the top.

One Response to “Apache Error: Unable to open logs”

  1. 1coatingon 12 Jan 2022 at 10:37 pm

    3underwent…

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.