Apache: Unable to open logs

Today at work I needed to add a SSLProxyEngine directive to my Puppet server configuration.

Unfortunately the puppetlabs/apache module does not support this directive without enabling SSL on the vhost, so I had to manually generate the config file.

After an hour, I had the configuration in place but starting Apache gave me the following output:

$ /etc/init.d/apache2 restart
[....] Restarting web server: apache2no listening sockets available,
shutting down Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
 failed!

The log directory /var/log/apache2/ was really not owned by www-data, so I fixed that. I tried to fix many more things, and finally strace'ed the apache process: Still the same error message, but not a single access to a log directory or file.

The real cause of the problem was that my apache configuration did not include a Listen directive, which meant that my vhost, although defined, was not used.

Still: a message Unable to open logs is hardly proper for a missing Listen line in the config.

Written by Christian Weiske.

Comments? Please send an e-mail.