Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

If I dont set a error log inside a virtual host it will default to the default error/access log. Is there a way to turn this off for one virtual host?

share|improve this question
up vote 15 down vote accepted

Within your <VirtualHost> block for the vhost in question you can configure the logs to be sent to /dev/null

<VirtualHost *:80>
     ServerName nologserver.tld

     ErrorLog /dev/null
     CustomLog /dev/null common
share|improve this answer
ErrorLog /dev/null

CustomLog /dev/null 

Should work for you

share|improve this answer
I get the following error when restarting apache after this change: Syntax error on line 71 of /etc/apache2/sites-enabled/ CustomLog takes two or three arguments, a file name, a custom log format string or format name, and an optional "env=" clause (see docs) – John Magnolia Sep 17 '11 at 8:35

Simply comment out the


Directives in your virtual host config file or as guys suggested send log data to /dev/null

share|improve this answer
anonymous comment left inline, moving to a comment: "Commenting out ErrorLog and CustomLog lines will result to log all events to common log (defined in main httpd.conf file). The only solution is to put the logs to /dev/null." – slm Aug 29 '13 at 22:06

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.