国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Der Index zeigt Informationen zur Apache- und PHP-Version an
伊謝爾倫
伊謝爾倫 2017-05-16 16:58:42
0
2
919

Meister, zeigen Sie die Apache- und PHP-Versionsinformationen im roten Feld im Bild an. Welches Konfigurationselement ist Apache?

伊謝爾倫
伊謝爾倫

小伙看你根骨奇佳,潛力無限,來學PHP伐。

Antworte allen(2)
習慣沉默

你所看到的這個文件目錄直接顯示的頁面,是Apache的 mod_autoindex 模塊負責處理的。

先說說之前別人提到的那個ServerSignatureServerTokens

ServerTokens Full
ServerSignature On

mod_autoindex 的末尾信息:
Apache/2.4.10 (系統(tǒng) Debian/Ubuntu/Windows之類的) OpenSSL/1.0.1t Server at your.domain.com Port 443

Http頭部:
Server:Apache/2.4.10 (系統(tǒng) Debian/Ubuntu/Windows之類的) OpenSSL/1.0.1t

ServerTokens Prod
ServerSignature Off

是這個樣子的:

mod_autoindex 的末尾信息:
Apache Server at your.domain.com Port 443

Http頭部:
Server:Apache

所以 ServerSignatureServerTokens 和你的問題沒什么直接關系。

也就是說,Apache沒有什么配置項能直接解決這個問題(Apache又不是必須和PHP結合,安裝了Apache人家憑什么給你順便顯示PHP的信息?)。

間接解決:我給的是Debian/Ubuntu系+mod_php的解決方案,別的系統(tǒng)估計也類似。

/etc/apache2/mods_enabled/autoindex.conf

</IfModule>前面加上:

AddHandler application/x-httpd-php .php
AddType text/html .php
ReadmeName /README.php  
HeaderName HEADER.html

ReadmeNameHeaderName 可能已經(jīng)存在,那就改掉。

然后在你網(wǎng)站的根目錄(your.domain.com/ 對應的那個目錄)建立README.php

內(nèi)容:

<?php
echo apache_get_version().', PHP Version:'.phpversion();
?>

注意啦,這里有個唯一可能跟 ServerTokens 有關的內(nèi)容,如果你配置的是 Prod, 則只能顯示出來Apache, 如果配置的是 Full 就會顯示我之前提到的那一大串詳細信息:

Apache/2.x.xx (系統(tǒng) Debian/Ubuntu/Windows之類的) OpenSSL/1.0.xx

另外如果直接在php里調(diào)用shell_exec獲得Apache版本號的話應該沒有限制,可以不動ServerTokens配置。

更多參見:

Apache mod_autoindex 對于Header和Readme的詳細說明
PHP 函數(shù),獲得Apache版本信息
PHP 獲得PHP版本信息
要在調(diào)用這個PHP之前聲明.php的Handler。盡管你在別處可能也有聲明,但是這個配置文件被Apache處理的順序比較靠前。所以要更提前的聲明
不同的ServerTokens顯示出來的信息都長啥樣

洪濤

這個主要涉及兩個配置 ServerSignatureServerTokens , ServerSignature 起開關作用,ServerTokens 控制顯示信息多少。
修改 httpd.conf 這兩個配置為以下,然后重啟就可以顯示。

ServerSignature On
ServerTokens Full

附兩個配置的相關值

  • ServerSignature : Off | On | Email

  • ServerTokens : Prod | Major | Minor | Min | OS | Full (顯示內(nèi)容從小到多)

Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage