How can i prevent server info
and php info
to be displayed in response header
Asked
Active
Viewed 3.4k times
1 Answers
58
for server info add the following lines in apache2.conf
ServerTokens ProductOnly
ServerSignature Off
For PHP info
in your php.ini
turn
expose_php = off

Engineer
- 5,911
- 4
- 31
- 58
-
9The latest syntax on debian & ubuntu servers is: `ServerSignature Off` `ServerTokens Prod` For anyone using those distros. – Kzqai May 25 '14 at 16:43
-
4If you are using a recent version of Ubuntu (~12+), these directives have been moved to /etc/apache2/conf.d/security. You must edit that file for your changes to have an effect (says pgschk on AskUbuntu: http://askubuntu.com/a/184366 and verified by me). – Adam Friedman Jan 27 '15 at 16:36
-
2More recently, these are in `/etc/apache2/conf-available/security.conf`. – Supernovah Apr 26 '20 at 04:21