真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

隱藏apache版本信息-創(chuàng)新互聯(lián)

隱藏apache版本信息

創(chuàng)新互聯(lián)建站為企業(yè)級(jí)客戶提高一站式互聯(lián)網(wǎng)+設(shè)計(jì)服務(wù),主要包括網(wǎng)站設(shè)計(jì)、做網(wǎng)站、app開發(fā)定制、小程序定制開發(fā)、宣傳片制作、LOGO設(shè)計(jì)等,幫助客戶快速提升營(yíng)銷能力和企業(yè)形象,創(chuàng)新互聯(lián)各部門都有經(jīng)驗(yàn)豐富的經(jīng)驗(yàn),可以確保每一個(gè)作品的質(zhì)量和創(chuàng)作周期,同時(shí)每年都有很多新員工加入,為我們帶來大量新的創(chuàng)意。 

######################################33

隱藏Apache信息

[root@LAMP ~]# curl -I 127.0.0.1

HTTP/1.1 200 OK

Date: Thu, 24 Sep 2015 01:47:29 GMT

Server: Apache/2.2.27 (Unix) DAV/2 PHP/5.3.27

X-Powered-By: PHP/5.3.27

Content-Type: text/html

##由此可見版本號(hào)為2.2.27

[root@LAMP ~]#

1 主配置中啟用httpd-default.conf

# vi /application/apache/conf/httpd.Conf

//找到httpd-default.conf,刪除includes前面的“#”,改成如下

Include conf/extra/httpd-default.conf

或者用sed命令

cd /application/apache/conf/

grep "Include conf/extra/httpd-default.conf" httpd.conf

sed -i 's$#Include conf/extra/httpd-default.conf$Include conf/extra/httpd-default.conf$g' httpd.conf

grep "Include conf/extra/httpd-default.conf" httpd.conf

修改httpd-default.conf

文件:/application/apache/conf/extra/httpd-default.conf

找到

ServerTokens Full

ServerSignature On

改成

ServerTokens Prod

ServerSignature off

########

或者用sed命令

cd /application/apache/conf/extra/

egrep "ServerTokens Full|ServerSignature On" httpd-default.conf

sed -i 's/ServerTokens Full/ServerTokens Prod/g' httpd-default.conf

sed -i 's/ServerSignature On/ServerSignature off/g' httpd-default.conf

egrep "ServerTokens |ServerSignature " httpd-default.conf

#########sed過程

[root@LAMP conf]# cd /application/apache/conf/extra/

[root@LAMP extra]# egrep "ServerTokens Full|ServerSignature On" httpd-default.conf

ServerTokens Full

ServerSignature On

[root@LAMP extra]# sed -i 's/ServerTokens Full/ServerTokens Prod/g' httpd-default.conf

[root@LAMP extra]# sed -i 's/ServerSignature On/ServerSignature off/g' httpd-default.conf

[root@LAMP extra]# egrep "ServerTokens |ServerSignature " httpd-default.conf

####################

重啟apache,查看是否修改了版本號(hào)

 curl -I 10.0.0.3

 /application/apache/bin/apachectl graceful

 curl -I 10.0.0.3

[root@LAMP extra]# /application/apache/bin/apachectl graceful

[root@LAMP extra]# curl -I 10.0.0.3

HTTP/1.1 200 OK

Date: Thu, 24 Sep 2015 01:54:18 GMT

Server: Apache

X-Powered-By: PHP/5.3.27

Content-Type: text/html

##由此可見版本號(hào)2.2.27不見了。但是版本apache還在

[root@LAMP extra]#

上面的方法只能修改版本號(hào),不能改變版本,如果需要改變版本,是默認(rèn)情況下安裝的Apache,如果是編譯安裝的,還可以用修改源碼編譯的方法:

修改下面兩個(gè)文件的內(nèi)容:

/home/lvnian/tools/httpd-2.2.27/include/ap_release.h

/home/lvnian/tools/httpd-2.2.27/os/unix/os.h

cp /home/lvnian/tools/httpd-2.2.27/include/ap_release.h /home/lvnian/tools/httpd-2.2.27/include/ap_release.h.ori

cp /home/lvnian/tools/httpd-2.2.27/os/unix/os.h /home/lvnian/tools/httpd-2.2.27/os/unix/os.h.ori

修改內(nèi)容如下:

#####################

 40 #define AP_SERVER_BASEVENDOR "Apache Software Foundation"

 41 #define AP_SERVER_BASEPROJECT "Apache HTTP Server"

 42 #define AP_SERVER_BASEPRODUCT "Apache"

 43

 44 #define AP_SERVER_MAJORVERSION_NUMBER 2

 45 #define AP_SERVER_MINORVERSION_NUMBER 2

 46 #define AP_SERVER_PATCHLEVEL_NUMBER  27

 47 #define AP_SERVER_DEVBUILD_BOOLEAN   0

 修改成下面內(nèi)容

 40 #define AP_SERVER_BASEVENDOR "lvnian IIS6 Software Foundation"

 41 #define AP_SERVER_BASEPROJECT "lvnian IIS6  HTTP Server"

 42 #define AP_SERVER_BASEPRODUCT "lvnian IIS6 "

 43

 44 #define AP_SERVER_MAJORVERSION_NUMBER 1

 45 #define AP_SERVER_MINORVERSION_NUMBER 3

 46 #define AP_SERVER_PATCHLEVEL_NUMBER  5

 47 #define AP_SERVER_DEVBUILD_BOOLEAN   7

 ###########################3

 用sed 修改如下:

grep -n '"Apache' /home/lvnian/tools/httpd-2.2.27/include/ap_release.h

cd /home/lvnian/tools/httpd-2.2.27/include/

sed -i 's/"Apache/"lvnian IIS6/g' ap_release.h

sed -n '40,42p' ap_release.h

sed -n '44,47p' ap_release.h

grep "AP_SERVER_MAJORVERSION_NUMBER 2" ap_release.h

sed -i 's/AP_SERVER_MAJORVERSION_NUMBER 2/AP_SERVER_MAJORVERSION_NUMBER 1/g' ap_release.h

sed -i 's/AP_SERVER_MINORVERSION_NUMBER 2/AP_SERVER_MINORVERSION_NUMBER 3/g' ap_release.h

sed -i 's/AP_SERVER_PATCHLEVEL_NUMBER  27/AP_SERVER_PATCHLEVEL_NUMBER  5/g' ap_release.h

sed -i 's/AP_SERVER_DEVBUILD_BOOLEAN   0/AP_SERVER_DEVBUILD_BOOLEAN   7/g' ap_release.h

sed -n '44,47p' ap_release.h

sed -n '39,47p' ap_release.h

############sed 命令過程

 [root@LAMP ~]# grep -n '"Apache' /home/lvnian/tools/httpd-2.2.27/include/ap_release.h

38: * Example: "Apache/1.1.0 MrWidget/0.1-alpha"

40:#define AP_SERVER_BASEVENDOR "Apache Software Foundation"

41:#define AP_SERVER_BASEPROJECT "Apache HTTP Server"

42:#define AP_SERVER_BASEPRODUCT "Apache"

[root@LAMP ~]# cd /home/lvnian/tools/httpd-2.2.27/include/

[root@LAMP include]# sed -i 's/"Apache/"lvnian IIS6/g' ap_release.h

[root@LAMP include]# sed -n '40,42p' ap_release.h

#define AP_SERVER_BASEVENDOR "lvnian IIS6 Software Foundation"

#define AP_SERVER_BASEPROJECT "lvnian IIS6 HTTP Server"

#define AP_SERVER_BASEPRODUCT "lvnian IIS6"

[root@LAMP include]# sed -n '44,47p' ap_release.h

#define AP_SERVER_MAJORVERSION_NUMBER 2

#define AP_SERVER_MINORVERSION_NUMBER 2

#define AP_SERVER_PATCHLEVEL_NUMBER  27

#define AP_SERVER_DEVBUILD_BOOLEAN   0

[root@LAMP include]# grep "AP_SERVER_MAJORVERSION_NUMBER 2" ap_release.h

#define AP_SERVER_MAJORVERSION_NUMBER 2

[root@LAMP include]# sed -i 's/AP_SERVER_MAJORVERSION_NUMBER 2/AP_SERVER_MAJORVERSION_NUMBER 1/g' ap_release.h

[root@LAMP include]# sed -i 's/AP_SERVER_PATCHLEVEL_NUMBER  27/AP_SERVER_PATCHLEVEL_NUMBER  5/g' ap_release.h

[root@LAMP include]# sed -i 's/AP_SERVER_DEVBUILD_BOOLEAN   0/AP_SERVER_DEVBUILD_BOOLEAN   7/g' ap_release.h

[root@LAMP include]# sed -n '44,47p' ap_release.h

#define AP_SERVER_MAJORVERSION_NUMBER 1

#define AP_SERVER_MINORVERSION_NUMBER 3

#define AP_SERVER_PATCHLEVEL_NUMBER  5

#define AP_SERVER_DEVBUILD_BOOLEAN   7

#############################################################################3

修改 /home/lvnian/tools/httpd-2.2.27/os/unix/os.h文件的下面內(nèi)容 ,修改成你想要修改的內(nèi)容

 35 #define PLATFORM "Unix"

 如修改成

#define PLATFORM "win32"

sed命令如下

cd /home/lvnian/tools/httpd-2.2.27/os/unix/

sed -n '/#define PLATFORM /p' os.h

sed -i 's/#define PLATFORM "Unix"/#define PLATFORM "LVNIAN WIN"/g' os.h

sed -n '/#define PLATFORM /p' os.h

##########

[root@LAMP unix]# sed -n '/#define PLATFORM /p' os.h

#define PLATFORM "Unix"

[root@LAMP unix]# sed -i 's/#define PLATFORM "Unix"/#define PLATFORM "LVNIAN WIN"/g' os.h

[root@LAMP unix]# sed -n '/#define PLATFORM /p' os.h

#define PLATFORM "LVNIAN WIN"

[root@LAMP unix]#

記得要上面的都不需要把#注銷去掉

備份配置文件,

重新編譯安裝

 pkill httpd

rm -rf /application/apache2.22.27

cd /home/lvnian/tools

cd httpd-2.2.27

./configure \

--prefix=/application/apache2.22.27 \

--enable-deflate \

--enable-expires \

--enable-headers \

--enable-modules=most \

--enable-so \

--with-mpm=worker \

--enable-rewrite

make && make install

##解決啟動(dòng)apache慢問題

grep -i  "#ServerName" /application/apache/conf/httpd.conf

sed -i '/#ServerName/aServerName 127.0.0.1:80' /application/apache/conf/httpd.conf

grep -i  "ServerName" /application/apache/conf/httpd.conf

##啟動(dòng)apache

 pkill httpd

 netstat -lnt

 /application/apache/bin/apachectl -t

/application/apache/bin/apachectl start

##測(cè)試

[root@LAMP httpd-2.2.27]# curl -I 10.0.0.3

HTTP/1.1 200 OK

Date: Thu, 24 Sep 2015 02:55:18 GMT

Server: lvnian IIS6/1.3.5-dev (LVNIAN WIN) DAV/2

Last-Modified: Sat, 20 Nov 2004 20:16:24 GMT

ETag: "20c8e-2c-3e9564c23b600"

Accept-Ranges: bytes

Content-Length: 44

Content-Type: text/html

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。


分享標(biāo)題:隱藏apache版本信息-創(chuàng)新互聯(lián)
本文URL:http://weahome.cn/article/igdcd.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部