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?


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
  • Would this work on Windows, too? – Uwe Keim May 18 '18 at 9:19
  • 1
    @UweKeim No, I'm looking for a Windows solution as well... – TheStoryCoder Jun 13 '18 at 13:05

Change /etc/apache2/conf-enabled/other-vhosts-access-log.conf to following:

ErrorLog /dev/null

CustomLog /dev/null common
|improve this answer|||||
  • I get the following error when restarting apache after this change: Syntax error on line 71 of /etc/apache2/sites-enabled/example.com: 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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