Question
How to disable Apache and nginx log files for domains on a Plesk for Linux server?
Answer
Note: This article may require additional administrative knowledge to apply. If any help required, contact server’s administrator or hosting support.
To disable Apache log files (access_log
, access_ssl_log
and error_log
), use one of the two possible ways:
Disable Apache log files for all domains
-
Connect to the server using SSH.
-
Copy default template
domainVirtualHost.php
to custom templates directory:# mkdir -p /usr/local/psa/admin/conf/templates/custom/domain/
# cp /usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php /usr/local/psa/admin/conf/templates/custom/domain
-
Remove the following lines from the file
domainVirtualHost.php
located in custom templates directory:<?php if (!$VAR->server->webserver->apache->pipelogEnabled): ?>
CustomLog <?php echo $VAR->domain->physicalHosting->logsDir ?>/<?php echo $OPT['ssl'] ? 'access_ssl_log' : 'access_log' ?> plesklog
<?php endif; ?>
ErrorLog "<?php echo $VAR->domain->physicalHosting->logsDir ?>/error_log" -
Reconfigure domains:
# plesk sbin httpdmng --reconfigure-all
Disable Apache log files for particular domains
-
Connect to the server using SSH.
-
Copy default template
domainVirtualHost.php
to custom templates directory:# mkdir -p /usr/local/psa/admin/conf/templates/custom/domain/
# cp /usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php /usr/local/psa/admin/conf/templates/custom/domain
-
Create the file
apachedomainlist.txt
with the list of domains (each domain should be on a new line) where Apache log-files…