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?
3 Answers
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
</VirtualHost>
-
-
1
-
What does the
common
part do? Why does the CustomLog need to be/dev/null common
rather than just/dev/null
? Jan 23, 2022 at 10:11 -
-
@user9517 - I don't see the "common" keyword listed anywhere. Which page of documentation contains info about it? Feb 7, 2022 at 10:13
Change /etc/apache2/conf-enabled/other-vhosts-access-log.conf to following:
ErrorLog /dev/null
CustomLog /dev/null common
-
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) Sep 17, 2011 at 8:35