Can you disable apache logs for a single site using htaccess or in the virtual host settings?

I work on a website where the client does not want ANY entrance to the site for privacy reasons. The site will be hosted on the same Apache web server as a number of other websites, so I can just disconnect in Apache. Is there a way to disable logging for an individual site using htaccess rules or by adding something to VirtualHost settings?

+6
source share
3 answers

Options look like

  • Sending to / dev / null on * nix or C: / nul on Windows ( see here )
  • Removing basic logging rules and duplicating them in each vhost (so there is no login for vhosts by default)

There seems to be some better way to do this, but what I found.

+7
source

Yes, just comment out (using "#") the ErrorLog and CustomLog entries in httpd conf for your virtual host.

http://www.mydigitallife.info/how-to-disable-and-turn-off-apache-httpd-access-and-error-log/

0
source

I achieve this by making the log dependent on a non-existent environment variable. So in .htaccess or VirtualHost you can:

 CustomLog /var/log/httpd/my_access_log combined env=DISABLED 

and as long as there is no environment variable called DISABLED , then you will not get any logs.

I really came here to find a tidier solution, but this works without modifying the global httpd.conf .

0
source

Source: https://habr.com/ru/post/912508/


All Articles