jueves, 3 de septiembre de 2015

How to globally disable X-Powered-By:PleskLin http://forum.odin.com/threads/how-to-globally-disable-x-powered-by-plesklin.333735/#post-782850

ORIGINAL ARTICLE http://forum.odin.com/threads/how-to-globally-disable-x-powered-by-plesklin.333735/#post-782850

Hi Hayk,

the "correct" usage would be:
  1. Create a folder called "custom" at "/usr/local/psa/admin/conf/templates/", so that you have a custom "custom" directory for your unique modifications ( => /usr/local/psa/admin/conf/templates/custom ).
  2. Create a folder called "domain" at "/usr/local/psa/admin/conf/templates/custom/", so that you have a custom "domain" directory for your unique modifications ( => /usr/local/psa/admin/conf/templates/custom/domain ).
  3. Copy the desired template(s) to the "custom" folder
    1. Command over the command line:
      Code:
      cp /usr/local/psa/admin/conf/templates/default/server.php /usr/local/psa/admin/conf/templates/custom/server.php
    2. Command over the command line:
      Code:
      cp /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php /usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php
  4. Delete / edit or modify the part of .../custom/server.php :
    Code:
    <IfModule mod_headers.c>
        Header add X-Powered-By PleskLin
    </IfModule>
  5. Delete / edit or modify the part of .../custom/domain/nginxDomainVirtualHost.php :
    Code:
    <?php if (!$VAR->domain->physicalHosting->proxySettings['nginxTransparentMode'] && !$VAR->domain->physicalHosting->proxySettings['nginxServeStatic']): ?>
        location /internal-nginx-static-location/ {
            alias <?php echo $OPT['documentRoot'] ?>/;
            add_header X-Powered-By PleskLin;
            internal;
        }    
  • Reconfigure your webserver with the command:
    Code:
    /usr/local/psa/admin/sbin/httpdmng --reconfigure-all
  • Smile to the camera and say: Cheeeeeeeeese :D

In some rare cases, you have to restart apache and nginx manually, even that the reconfigure-command includes the restarts of the two services.