Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My apache2.conf file contains the lines ErrorLog /var/www/logs/error_log and CustomLog /var/www/logs/access_log common. I only get server shutdown/restart notifications there, however. All other logs get sent to the original locations (/var/log/apache2). I wasted a day debugging in the blind until I worked that out. How do I get all my logs to get sent where I want them?

The (condensed) apache2.conf file looks similar to this (without the modules and directories):

LockFile ${APACHE_LOCK_DIR}/accept.lock
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
AccessFileName .htaccess
DefaultType None
HostnameLookups Off
ErrorLog /var/www/logs/error_log
LogLevel debug
Include mods-enabled/*.load
Include mods-enabled/*.conf
Include httpd.conf
Include ports.conf
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog /var/www/logs/access_log common
Include conf.d/
Include sites-enabled/

ServerRoot /var/www
DocumentRoot /var/www
AddType application/x-httpd-cgi .cgi

share|improve this question
up vote 2 down vote accepted

What do you mean by all other logs? You have probably defined a number of virtual hosts and these other logs belong to them. So, you should set log file locations on a per virtual host basis in corresponding VirtualHost configuration sections.

share|improve this answer
Actually, I haven't even got to virtual hosts yet. It's not a complicated setup. I meant "all other logging", rather than "all other logs". Sorry. Anyway, the logs in question are error.log, access.log and other_vhosts_access.log. – Warpspace Aug 8 '12 at 11:16
I suppose you are on Debian or Ubuntu, please check /etc/apache2/sites-available/default, your default VirtualHost configuration is right there. – Alex Aug 8 '12 at 11:20
Ah, you're right. There's another ErrorLog and CustomLog there. Is it better to modify that file, or do something in the apache2.conf file to make it use my settings? – Warpspace Aug 8 '12 at 11:23
Well since settings are per virtual host it's better to modify that file I think. – Alex Aug 8 '12 at 11:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.