> 文章列表 > Ubuntu中隐藏Apache的版本号等信息

Ubuntu中隐藏Apache的版本号等信息

Ubuntu中隐藏Apache的版本号等信息

Ubuntu中隐藏Apache的版本号等信息

vim /etc/apache2/apache2.conf

在apache主配置文件的末尾增加以下内容:

ServerTokens Prod
ServerSignature off

Ubuntu中隐藏Apache的版本号等信息
ServerTokens:
默认阀值为Full,以apache-2.0.55为例,阀值可以设定为以下某项(后面为相对应的Banner Header):
Prod >>> Server: Apache
Major >>> Server: Apache/2
Minor >>> Server: Apache/2.0
Minimal >>> Server: Apache/2.0.55
OS >>> Server: Apache/2.0.55 (Debian)
Full (or not specified) default >>> Server: Apache/2.0.55 (Debian) PHP/5.1.2-1+b1 mod_ssl/2.0.55 OpenSSL/0.9.8b

ServerSignature:
该指令如果设置为Off,那么服务器生成的网页底端不会有附加信息,如果设置为On,那么在某些情况下(比如目录列表),服务器生成的网页底部会有Server等信息,如下图:

ServerSignature off 时:
Ubuntu中隐藏Apache的版本号等信息
ServerSignature on 时:
Ubuntu中隐藏Apache的版本号等信息