更改http标头信息以隐藏服务器信息 [英] Changing the http header info to hide server info

查看:382
本文介绍了更改http标头信息以隐藏服务器信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是我是否可以省略使用php在http头中发送的服务器信息?我知道它本身并不危险,但幽默我。如果我想省略这些信息,我该怎么做呢。如果我想插入错误的服务器信息以引导潜在的有害用户误入歧途怎么样?我看过php doc,但我找不到它。谢谢。

My question is whether I can omit my server info from being sent in the http header using php? I know by itself it is not dangerous, but humor me. If I wanted to omit that information, how would I do this. How about if I wanted to insert false server information as to lead potential harmful users astray? I have looked at the php doc, but I could not find it. Thanks.

推荐答案

我不知道使用PHP来做这件事是正确的方法。服务器是否运行Apache?如果是这样,您可以将以下选项添加到配置文件中以隐藏服务器信息:

I don't know if using PHP to do this is the right approach. Is the server running Apache? If so, you can add the following options to your config file to hide server info:

ServerTokens ProductOnly
ServerSignature Off

要隐藏PHP信息,请编辑 php.ini 并添加以下行:

To hide PHP info, edit your php.ini and add the line:

expose_php Off

或者,如果此选项已存在,请从 On 更改为 Off

Or, if this option already exists, change from On to Off.

参考: http://www.debianadmin.com/apache-tipshide-apache-information-php-software-version.html

这篇关于更改http标头信息以隐藏服务器信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆