如何判断一个网站用的Apache还是ngx?通过哪些配置文件可以判断?
回复内容:
如何判断一个网站用的Apache还是ngx?通过哪些配置文件可以判断?
response header里有一个server字段可以判断
你们答案简单粗暴,但是遇到某些情况是没什么用的,例如:
lighttpd修改
setenv.add-response-header = ( "Server" => "SSHTTPd",
"X-Powered-By" => "SSPPP")
你们找到header的也不过是
Accept-Ranges:bytes
Content-Length:325
Content-Type:image/gif
Date:Wed, 03 Sep 2014 04:03:17 GMT
ETag:"692905520"
Last-Modified:Mon, 28 Oct 2013 05:17:31 GMT
Server:SSHTTPd
X-Powered-By:SSPPP
完全没什么用。
所以,我说一种方案:
XXX@A-PC:~$ nmap -sV XXX.XXX.XXX
Starting Nmap 6.40 ( http://nmap.org ) at 2014-09-06 05:59 CST
Nmap scan report for IP和域名隐藏了。。
Host is up (0.0049s latency).
Not shown: 999 filtered ports
PORT STATE SERVICE VERSION
80/tcp open http lighttpd
这个就很准确了。(用的也是修改过header的lighttpd)
当然如果他们铁下心要去修改源码来修改header,
那你们就从了吧。
打开浏览器-F12-打开URL
装个Wappalyzer,是个chrome的扩展,如果网站做了负载均衡的话,那就知道不了了
這個問題可以推廣到更普適的版本,那就是如何分辨任意網站背後的服務器程序。答案是沒有辦法。因爲服務器程序對用戶而言,做的是等價的工作,必然無法分辨。那麼狹隘一些,對於已知服務器程序類型,如何分辨?答案是,根據特性。
常見的特性有哪些?自然就是非標準的行爲,比如自定義的 HTTP 頭,Server 的返回值等等。但這些都可以僞造,因爲服務器程序的本質行爲都一樣,特性改成什麼樣,不影響。
所以,即便是對 Apache 和 ngx,普遍適用的判斷方法依舊不存在。
怎麼辦?根據具體問題具體分析,先收集二者的細微差異,提出假設,設計實驗驗證或推翻,逐步推倒出可能性更大的一種選擇。相信只要內部實現不同,在外部總能找到差異。
人肉打听一下这个网站是谁运维的,然后想办法去问他
chrome f12,点network,找到那个网页的记录,看返回头中的Server
。
我要是故意修改后,你能知道吗?
如果配置没改的话
$ curl -I http://segmentfault.com/q/1010000000659515 HTTP/1.1 200 OK Server: ASERVER/1.2.9-3 Date: Sat, 06 Sep 2014 14:02:13 GMT Content-Type: text/html; charset=UTF-8 Connection: keep-alive X-Powered-By: PHP/5.5.9-1ubuntu4.3 Set-Cookie: sfsess=dyOChB.f0350a50e8f6a4f3fe211ae191c835e6.a; expires=Sun, 07-Se p-2014 14:02:12 GMT; Max-Age=86400; path=/; domain=segmentfault.com X-Powered-By-Anquanbao: MISS from dxt-bj-sj-s91
不同的server的不同版本,http header 字段的排序有可能是不同的。
通过 HTTP Server 头是最简单的方法,不过这个头可以通过配置去掉。所以实际上没有精确的方法知道 web server 的类型。不过可以通过经验也就是统计方法。
参见:http://www.zhihu.com/question/21621809
chrome的话可以安装插件wappalyzer,网站使用的技术都可以显示出来
同意@大舒的看法
另: 如果nginx作为代理服务器分发到apache, 应该算什么?
传送门:ChromeSnifferPlus
想要得到最靠谱的答案: 去问人家。
从response里看的都是可以伪装的。

APHPDependencyInjectionContainerisatoolthatmanagesclassdependencies,enhancingcodemodularity,testability,andmaintainability.Itactsasacentralhubforcreatingandinjectingdependencies,thusreducingtightcouplingandeasingunittesting.

Select DependencyInjection (DI) for large applications, ServiceLocator is suitable for small projects or prototypes. 1) DI improves the testability and modularity of the code through constructor injection. 2) ServiceLocator obtains services through center registration, which is convenient but may lead to an increase in code coupling.

PHPapplicationscanbeoptimizedforspeedandefficiencyby:1)enablingopcacheinphp.ini,2)usingpreparedstatementswithPDOfordatabasequeries,3)replacingloopswitharray_filterandarray_mapfordataprocessing,4)configuringNginxasareverseproxy,5)implementingcachingwi

PHPemailvalidationinvolvesthreesteps:1)Formatvalidationusingregularexpressionstochecktheemailformat;2)DNSvalidationtoensurethedomainhasavalidMXrecord;3)SMTPvalidation,themostthoroughmethod,whichchecksifthemailboxexistsbyconnectingtotheSMTPserver.Impl

TomakePHPapplicationsfaster,followthesesteps:1)UseOpcodeCachinglikeOPcachetostoreprecompiledscriptbytecode.2)MinimizeDatabaseQueriesbyusingquerycachingandefficientindexing.3)LeveragePHP7 Featuresforbettercodeefficiency.4)ImplementCachingStrategiessuc

ToimprovePHPapplicationspeed,followthesesteps:1)EnableopcodecachingwithAPCutoreducescriptexecutiontime.2)ImplementdatabasequerycachingusingPDOtominimizedatabasehits.3)UseHTTP/2tomultiplexrequestsandreduceconnectionoverhead.4)Limitsessionusagebyclosin

Dependency injection (DI) significantly improves the testability of PHP code by explicitly transitive dependencies. 1) DI decoupling classes and specific implementations make testing and maintenance more flexible. 2) Among the three types, the constructor injects explicit expression dependencies to keep the state consistent. 3) Use DI containers to manage complex dependencies to improve code quality and development efficiency.

DatabasequeryoptimizationinPHPinvolvesseveralstrategiestoenhanceperformance.1)Selectonlynecessarycolumnstoreducedatatransfer.2)Useindexingtospeedupdataretrieval.3)Implementquerycachingtostoreresultsoffrequentqueries.4)Utilizepreparedstatementsforeffi


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Dreamweaver Mac version
Visual web development tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

WebStorm Mac version
Useful JavaScript development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment
