查看隐藏版本号命令:curl -I http://192.168.200.115
安装Nginx后查看:
[[email protected] nginx-1.16.0]# curl -I http://192.168.200.120
HTTP/1.1 200 OK
Server: nginx/1.16.0
Date: Thu, 12 Sep 2019 03:55:10 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Thu, 12 Sep 2019 01:08:46 GMT
Connection: keep-alive
ETag: "5d799a9e-264"
Accept-Ranges: bytes
隐藏版本号方法1:(安装Nginx后要修改文件必须先卸载Nginx再安装)
[[email protected] ~]# killall -9 nginx //杀死nginx进程
[[email protected] ~]# rm -rf /usr/local/nginx/
[[email protected] ~]# cd /usr/src/nginx-1.16.0/
[[email protected] nginx-1.16.0]# make clean
rm -rf Makefile objs
[[email protected] nginx-1.16.0]# cd
[[email protected] ~]# rm -rf /usr/src/nginx-1.16.0/ //卸载完成
[[email protected] ~]# tar xf nginx-1.16.0.tar.gz -C /usr/src
[[email protected] ~]# cd /usr/src/nginx-1.16.0/
[[email protected] nginx-1.16.0]# vim src/core/nginx.h
修改文件前图示:
修改文件后图示:
[[email protected] nginx-1.16.0]# ./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module
[[email protected] nginx-1.16.0]# make
[[email protected] nginx-1.16.0]# make install
[[email protected] nginx-1.16.0]# curl -I http://192.168.200.120
curl: (7) Failed connect to 192.168.200.120:80; 拒绝连接
[[email protected] nginx-1.16.0]# netstat -anpt | grep nginx
[[email protected] nginx-1.16.0]# nginx
[[email protected] nginx-1.16.0]# netstat -anpt | grep nginx
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 21446/nginx: master
[[email protected] nginx-1.16.0]# curl -I http://192.168.200.120
HTTP/1.1 200 OK
Server: apache/2.4.31
Date: Thu, 12 Sep 2019 04:15:38 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Thu, 12 Sep 2019 04:13:25 GMT
Connection: keep-alive
ETag: "5d79c5e5-264"
Accept-Ranges: bytes
原文地址:https://www.cnblogs.com/cxm123123form/p/11511123.html