• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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