Plesk

How to disable Apache and nginx log files for domains on Plesk for Linux server?

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

  1. Connect to the server using SSH.

  2. 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

  3. 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"

  4. Reconfigure domains:

    # plesk sbin httpdmng --reconfigure-all

Disable Apache log files for particular domains

  1. Connect to the server using SSH.

  2. 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

  3. Create the file apachedomainlist.txt with the list of domains (each domain should be on a new line) where Apache log-files…

Exit mobile version