如何查看web服务器的名称和版本号

/*********************************************************************
* Author : Samson
* Date : 04/26/2012
* Test platform:
* GNU Linux version 2.6.29.4
* gcc version 4.4.0 20090506 (Red Hat 4.4.0-4) (GCC)

* *******************************************************************/


有些时候想看一看web服务器的使用的服务器名字和版本号,至少有三种方法(在*nix环境下)可以办到。

0、最简单的方法就是使用抓包工具,例如: wireshark ethereal(wireshark前身)等;

1、还是比较简单的方法,是使用命令wget -S URL进行获取;

以www.xunlei.com为例,得到如下结果:

[root@UFO bbiinn]# wget -S www.xunlei.com
--2012-04-27 01:00:48-- http://www.xunlei.com/
正在解析主机 www.xunlei.com... 119.147.41.83, 121.14.82.140, 121.14.82.141, ...
Connecting to www.xunlei.com|119.147.41.83|:80... 已连接。
已发出 HTTP 请求,正在等待回应...
HTTP/1.1 200 OK
Server: nginx/1.0.11
Date: Thu, 26 Apr 2012 09:00:51 GMT
Content-Type: text/html
Connection: close
Vary: Accept-Encoding
Expires: Thu, 26 Apr 2012 10:00:51 GMT
Cache-Control: max-age=3600

2、还是比较简单的方法,是使用命令curl -I URL进行获取;

以www.xunlei.com为例,得到如下结果:

[root@UFO bbiinn]# curl -I www.xunlei.com
HTTP/1.1 200 OK
Server: nginx/0.7.69
Date: Thu, 26 Apr 2012 08:40:05 GMT
Content-Type: text/html
Connection: keep-alive
Vary: Accept-Encoding
Expires: Thu, 26 Apr 2012 09:40:05 GMT
Cache-Control: max-age=3600

3、还是有一种简单的方法,自己编写一个使用原始套接字方式编程的程序进行抓包;


比较细心的人应该会发现,1和2得的服务器名称都是一样的,但是为什么版本不一样呢?这说明xunlei使用的nginx服务器不只一台且不只一个版本的,这个细节可以通过方法0很画面感的看到;

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
查看运行在 Docker 中的 RabbitMQ 版本号,可以使用以下命令: ``` docker exec <rabbitmq-container-name> rabbitmqctl status | grep RabbitMQ ``` 其中,`<rabbitmq-container-name>` 是 RabbitMQ 容器的名称。 执行上述命令后,会输出 RabbitMQ 的相关信息,其中包括版本号,例如: ``` Status of node rabbit@<container-id> ... [{pid,<pid>}, {running_applications,[{rabbitmq_management,"RabbitMQ Management Console","3.6.9"}, {rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.6.9"}, {rabbitmq_management_agent,"RabbitMQ Management Agent","3.6.9"}, {rabbit,"RabbitMQ","3.6.9"}, {mnesia,"MNESIA CXC 138 12","4.14.3"}, {amqp_client,"RabbitMQ AMQP Client","3.6.9"}, {rabbit_common,[],"3.6.9"}, {os_mon,"CPO CXC 138 46","2.4"}, {cowboy,"Small, fast, modern HTTP server.","1.0.1"}, {cowlib,"Support library for manipulating Web protocols.","1.0.0"}, {jsx,"a streaming, evented json parsing toolkit","2.8.2"}]}, {os,{unix,linux}}, {erlang_version,"Erlang/OTP 19 [erts-8.3.5.6] [source] [64-bit] [smp:4:4] [async-threads:64] [kernel-poll:true]\n"}, {memory,[{total,58824560}, {connection_readers,0}, {connection_writers,0}, {connection_channels,0}, {connection_other,0}, {queue_procs,0}, {queue_slave_procs,0}, {plugins,0}, {other_proc,192168}, {mnesia,11496}, {mgmt_db,0}, {msg_index,0}, {other_ets,1524800}, {binary,16680}, {code,23251859}, {atom,1338425}, {other_system,1985011}]}, {alarms,[]}, {listeners,[{clustering,25672,"::"},{amqp,5672,"::"}]}, {vm_memory_high_watermark,0.4}, {vm_memory_limit,834841753}, {disk_free_limit,50000000}, {disk_free,8942155264}, {file_descriptors,[{total_limit,1048576}, {total_used,2}, {sockets_limit,943626}, {sockets_used,0}]}, {processes,[{limit,1048576},{used,192169}]}, {run_queue,0}, {uptime,4258}] ``` 在上述信息中,可以看到 RabbitMQ 的版本号为 `3.6.9`。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值