Turn off Directadmin Apache Access Logging Print

  • 0

 

Standard every domain in Directadmin has an apache access log mostly it has unuseful results like this:

162.158.111.140 - - [17/Aug/2020:21:09:39 +0000] "GET /contact HTTP/1.0" 200 45172 "-" "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.92 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"

Often they are bots that scan your entire website which can make these logs grow nicely, which also takes more backup space.

Writing log information is a time-consuming process. Although Apache keeps the log files open so that it's just a case of writing the information, this can take up valuable time. If storing log information is not required, you can save a few processor cycles by disabling it.

How to disable access logs in Directadmin for all domains

cd /usr/local/directadmin/data/templates
cp virtual_host2*.conf custom
cd custom

Open one by one files in /usr/local/directadmin/data/templates/custom

nano /usr/local/directadmin/data/templates/customvirtual_host2.conf
nano /usr/local/directadmin/data/templates/customvirtual_host2_secure.conf
nano /usr/local/directadmin/data/templates/customvirtual_host2_secure_sub.conf
nano /usr/local/directadmin/data/templates/customvirtual_host2_sub.conf


and replace

        CustomLog /var/log/httpd/domains/|DOMAIN|.log combined
with:
        CustomLog /dev/null combined

and after that run

echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue

Was dit antwoord nuttig?

« Terug