skip to Main Content

In a website made with WordPress, I’m trying to find out how I hide the version of PHP and Apache2 when I inspect the site.

I think that should be in 000-default.conf?

I tried to use

expose_php = Off

in php.ini, but it doesn’t work

2

Answers


  1. Chosen as BEST ANSWER

    To hide the version of apache, you should add in the server configuration file:

    ServerTokens Prod 
    ServerSignature Off
    

  2. Apache have /etc/apache2/conf-available/security.conf file for these configurations

    You need to edit it and set
    ServerTokens from OS to Prod

    and
    ServerSignature from On to Off

    Thats the best way to do that, since this applies to all server configuration

    If security conf was not enabled yet, just run ( as super user / root ) on terminal:

    a2enconf secutiry; service apache2 restart

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search