Hopefully this helps others. The original thread is from https://stackoverflow.com/questions/525057/why-cant-i-get-apaches-customlog-directive-to-work
Workaround 1
Delete the CustomLog directive from your configuration file, if you have it set up in a separate configuration file.
Add the CustomLog directive to your site's VirtualHost entry. For me this was in /etc/apache2/sites-available/default-ssl because I'm only allowing SSL access to the Subversion repository. If you are using /etc/apache2/sites-available/default, you will want to edit that file instead (or in addition to default-ssl if you are using both).
Restart Apache:
sudo /etc/init.d/apache2 restart
Pro
You can have multiple CustomLog directives in the VirtualHost entry for your site, and they will all work.
Con
You have to move your CustomLog entry into your site's VirtualHost entry instead of having it in a separate configuration file.
Workaround 2
Comment out the CustomLog directive(s) in your site's VirtualHost entry. If you're using one of the default site configurations (default or default-ssl), there will be a CustomLog directive for the access log that you will need to comment out (yes, this turns off Apache's default access logging).
Add your CustomLog directive to the appropriate configuration file. For me this was /etc/apache2/mods-available/dav_svn.conf.
Restart Apache:
sudo /etc/init.d/apache2 restart
Pro
You can keep your CustomLog directive in a separate configuration file.
Con
This workaround has the obvious disadvantage that you have to disable Apache's default access logging, but for me I don't care that much since I'm only using the server for Subversion access.
Conclusion
Neither of these workarounds are really ideal, but so far I haven't found a way to get it to work other than than the two workarounds above. I suppose we'll have to wait for the next release of Apache for this issue to be fixed.
Did you check the permissions of /etc/http/conf.d/prefork.conf
. If you created the file as root
or another user and the permissions aren't o+r
, apache user might not be able to read the file.
This would probably be visible in server logs.
Another problem might be that if the ServerRoot
is not set to /etc/http/
, the IncludeOptional would not work. You can try setting it to a full path:
IncludeOptional /etc/http/conf.d/*.conf
Best Answer
conf-enabled
is for global configuration excerpts that affect all vhosts.sites-enabled
should only contain complete vhost definitions.Of course, you can also include
conf-enabled/*
in your vhost definition if that makes sense in your setup.