Improve Apache Web Server Security: Use ServerTokens and ServerSignature to Disable Header改善Apache Web服務器安全:使用servertokens和serversignature禁用標題

When Apache HTTPD web server generates any web pages or error pages, some important information about the version and other details implemented on the system are displayed in th web site server header.當Apache的httpd Web服務器產生的任何網頁或錯誤網頁,一些重要的信息有關的版本和其他細節,實施該系統顯示在次網站服務器的標題。 For example, the information text may be like this:舉例來說,信息文本可能會是這樣的:

Server: Apache/1.3.37 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a PHP-CGI/0.1b服務器: apache/1.3.37 ( UNIX的) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 frontpage/5.0.2.2635.sr1.2 mod_ssl/2.8.28 openssl/0.9.7a php-cgi/0.1b

Server: Apache/2.0.53 (Ubuntu) PHP/4.3.10-10ubuntu4 Server at xx.xx.xx.xx Port 80服務器: apache/2.0.53 ( Ubuntu的) php/4.3.10-10ubuntu4服務器上xx.xx.xx.xx端口80


The line in the server header expose important version and variant information about the Linux operating system and Apache software used on the machine, indirectly expose the possible security holes that are existed to the hackers, or at least make malicious attackers easier to identify your system for available attack points.該線在服務器上的標題,揭露重要的版本和變體的資料, Linux操作系統和Apache軟件使用的機器,間接揭露可能的安全漏洞是存在的黑客,或者至少使惡意攻擊者更容易識別您的系統現有的攻擊點。

To ensure that the Apache HTTP web server does not broadcast this message to the whole world publicly and fix possible security issue, modify these two directives ServerTokes and ServerSignature in httpd.conf configuration file.以確保Apache的HTTP Web服務器不播出這個訊息,以整個世界的公開和修復可能的安全問題,修改這兩個指令servertokesserversignature在httpd.conf配置文件。

  1. Login as root user or perform a sudo to the web server.以root身份登錄的用戶或執行sudo的到Web服務器。
  2. Open and edit httpd.conf or apache2.conf (in Apache 2) with vi or other text editor.打開並修改httpd.conf文件或apache2.conf (在Apache 2 )與六或其他文本編輯器。 The Apache configuration normally located in /etc/httpd/conf/ or /etc/apache2/ or /etc/apache/ (for Apache1.3) depending on which Unix you’re using. Apache的配置通常位於在/ etc /的httpd /設置/或/ etc/apache2 /或/ etc /阿帕奇/ ( apache1.3 )根據其中的UNIX您使用。
  3. Locate the line with ServerTokens .找到符合servertokens You can perform a search by typing “/ServerTokes” and hit Enter.您可以執行搜索中鍵入“ / servertokes ”和回車鍵。
  4. In Apache 1.3, you will likely to see a line starts with #ServerTokes Full In this case, remove or delete the # character (by pressing d key).在Apache 1.3的,您可能會看到一條線開始# servertokes充分在這種情況下,移除或刪除#字符(按d鍵) 。 Also modify the Full to become Prod (press r key to replace one character, or R to replace multiple characters), so that the line becomes ServerTokens Prod .還修改了充分成為產品(按R鍵,以取代一個字符,或R ,以取代多個字符) ,使該線成為servertokens產品 In Apache 2.0 or 2.2, the line normally does not exist.在Apache 2.0或2.2 ,該行通常是不存在的。 So the search will fail.因此,搜索將失敗。 In this case, go to the bottom of config file, and add the new line with the following text.在這種情況下,去底部的config檔案,並添加新的符合下列文字。 You can add new line by pressing o key.您可以添加新線緊迫o的關鍵。

    ServerTokens Prod servertokens產品

  5. Next, search for ServerSignature.未來,搜索為serversignature 。 In Apache13, the line should just above the line of ServerTokens.在apache13 ,該行應略高於線servertokens 。 Edit the line so that it looks like this, and in Apache2 which doesn’t already have this line, add in at new one.編輯路線,以便它看起來是這個樣子,並在Apache2中不已經有這條線,加上在新一。

    ServerSignature Off serversignature小康

  6. By now the Apache configuration file should have this two directives set as below:現在Apache的配置文件應該有這兩項指令定為如下:

    ServerSignature Off serversignature小康
    ServerTokens Prod servertokens產品

    The first line “ServerSignature Off” instructs Apache not to display a trailing footer line under server-generated documents (error messages, mod_proxy ftp directory listings, mod_info output, and etc) which displays server version number, ServerName of the serving virtual host, email setting, and creates a “mailto:” reference to the ServerAdmin of the referenced document.第一行“ serversignature小康”指示的Apache不顯示一個尾隨頁腳線下的服務器所產生的文件(錯誤訊息, mod_proxy FTP目錄列表, mod_info輸出,等) ,其中顯示服務器版本號,服務器的虛擬主機服務,電子郵件設置,並創建一個“的mailto : ”提到了serveradmin所引用的文件。

    The second line “ServerTokens Prod” configures Apache to return only Apache as product in the server response header on very page request, suppressing OS, major and minor version info.第二行“ servertokens產品”配置的Apache只返回Apache的產品在服務器的響應頭就非常的頁面請求,抑制操作系統,主要和次要版本信息。

  7. Save and close the config file by pressing Shift-Colon, and then type wq keys, and hit Enter.保存並關閉配置文件由緊迫的轉移結腸,然後鍵入wq鍵,回車鍵。
  8. Restart Apache.重新啟動Apache的。 Typical command is service httpd restart or /etc/init.d/apache2 restart .典型的命令是服務的httpd重新啟動/ etc/init.d/apache2重新啟動
  9. Now, you will get only the Apache in the server response header:現在,你會得到的唯一的Apache在服務器的響應標題:

    Server: Apache服務器:阿帕奇

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要說明 :這是一個機器翻譯網頁是“按原樣”提供的擔保。 Machine translation may be difficult to understand.機器翻譯可能很難理解。 Please refer to請參閱 original English article英文原版的文章 whenever possible.只要有可能。

Share and contribute or get technical support and help at分享和貢獻,或取得技術的支持和幫助,在 My Digital Life Forums 我的數字生活論壇 .



Leave a Reply離開的答复

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> 您可以使用這些標籤:的<a href="" title=""> <abbr title=""> <acronym title="">的<b> <blockquote cite=""> <cite>的<code> <刪除日期時間= “ ” >的<em>的<i> <q cite=""> <strike>的<strong>

Subscribe without commenting訂閱無評論


Custom Search

New Articles新的條款,

Incoming Search Terms for the Article傳入的搜索條件文章

servertokens servertokens - - apache ServerTokens 阿帕奇servertokens - - servertokens prod servertokens產品 - - servertokens apache servertokens阿帕奇 - - apache ServerSignature 阿帕奇serversignature - - apache remove server header 阿帕奇刪除服務器標題 - - apache servertoken 阿帕奇servertoken - - apache2 ServerToken Apache2中servertoken - - apache server signature Apache服務器簽名 - - ServerTokens servertokens - - serversignature serversignature - - apache2 ServerTokens Apache2中servertokens - - Apache turn off server signature 阿帕奇關閉服務器簽名 - - apache server tokens Apache服務器的令牌 - - ServerSignature ServerTokens serversignature servertokens - - custom serversignature apache 自定義serversignature阿帕奇 - - ServerTokens prod apache2 servertokens產品的Apache2 - - disable server header 禁用服務器標題 - - apache disable headers 阿帕奇禁用標題 - - cpanel servertokens 的cPanel servertokens - - turn off ServerTokens 關閉servertokens - - turn off server signature 關閉服務器簽名 - - PROD Apache2 產品的Apache2 - - servertokens httpd.conf servertokens的httpd.conf - - apache2 disable server info Apache2中禁用服務器信息 - - apache modify server header 阿帕奇修改服務器的標題 - - apache serversignature custom 阿帕奇serversignature自訂 - - apache disable server info 阿帕奇禁用服務器信息 - - httpd.conf ServerTokens Prod httpd.conf中servertokens產品 - - httpd.conf ServerTokens httpd.conf中servertokens - - ServerTokens custom servertokens自訂 - - apache ServerTokens ServerSignature 阿帕奇servertokens serversignature - - apache2 serversignature Apache2中serversignature - - cpanel ServerSignature lost 失去的cPanel serversignature - - security ServerSignature 安全serversignature - - remove apache header 刪除阿帕奇標題 - - apache 2.0 disable server header 的Apache 2.0禁用服務器標題 - - apache ServerTokens Off 阿帕奇servertokens小康 - - remove apache server header 刪除Apache服務器標題 - - apache 2.2 serversignature 阿帕奇2.2 serversignature - - apache server header Apache服務器的標題 - - remove Server header 刪除服務器標題 - - apache remove header 阿帕奇刪除標題 - - all 全部 - - apache change server signature 阿帕奇變更伺服器簽名 - - improve apache 1.3 response 改善Apache 1.3的回應 - - apache disable server header 阿帕奇禁用服務器標題 - - ServerTokens still displays full header servertokens仍然顯示完整標題 - - Apache ServerTokens remove server header 阿帕奇servertokens刪除服務器標題 - - server header removal apache 服務器頁眉去除阿帕奇 - -