• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Remove X-Powered-By

neo2012

Basic Pleskian
Hello,
I use an Ubuntu 14.04.3 LTS Server with Plesk 12.5.30 Update #18.
Is it possible to completly remove the X-Powered-By in the header?
In the Plesk Panel I added for additional Apache HTTP commands: "Header unset X-Powered-By".
This removed the "PleskLin" in the X-Powered-By.
So the resulting header is: X-Powered-By PHP/5.5.9-1ubuntu4.14
Can I even remove the rest?
And how can I change the Cache-Control in the header?
The command: Header set Cache-Control "max-age=86400, public, must-revalidate"
only adds this value and does not remove the default.

Thank you for your help!
 
Hi neo2012,
the X-Powered-By header is removable via the server.php (line 59) template located at..
Code:
/opt/psa/admin/conf/templates/default/server.php


copy this file to...
Code:
/opt/psa/admin/conf/templates/custom/server.php


If you don't have the custom folder, just create it, once you have copied the file into the custom folder you can edit it.
Then you will have to regenerate the server conf files with...
Code:
/opt/psa/admin/bin/httpdmng --reconfigure-all


Now check your headers.
Hope that helps
Kind regards

Lloyd
 
Thank you for your quick answer. My answer is a little late, but that has reasons.
Your answer helped for removing "Plesklin" but "X-Powered-ByPHP/5.5.9-1ubuntu4.14" still appears in the Header. Is there a way to remove that?
Thanks again!
 
Thanks. I changed it in the files you wrote, but after apache restart it was still showing the version. Then I changed it in the PHP config in Plesk Panel and added:
expose_php = off
Then it worked.
EDIT: In static nginx files the header still shows "X-Powered-By PlesLin", where can I remove this? EDIT2: I changed like in an older threat the template in "/opt/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php" and removed there the "add_header X-Powered-By PleskLin" line. That solved this.
 
Last edited:
Back
Top