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

Add `ulimit -n 65536` command to /etc/rc.d/init.d/httpd and /usr/sbin/apachectl apache startup scripts before other commands.

Both comments and pings are currently closed.

Comments are closed.