隐藏系统和 Apache 的版本信息
方法一:
※首先修改源文件,再进行 make && make install 编译安装 编辑源文件/usr/local/apache2/include/ap_release.h 文件 [root@Nagios-Server include]# vimap_release.h
#define AP_SERVER_BASEPRODUCT "IIS"
#define AP_SERVER_MAJORVERSION_NUMBER 7
#define AP_SERVER_MINORVERSION_NUMBER 0
#define AP_SERVER_PATCHLEVEL_NUMBER 0
#define AP_SERVER_DEVBUILD_BOOLEAN 0 编辑源文件/usr/local/apache2/include/os.h 文件 [root@Nagios-Server include]# vimos.h
#define PLATFORM "Win32" 方法二:
[root@Nagios-Server include]# vim /usr/local/apache2/conf/httpd.conf
# Various default settings
Include conf/extra/httpd-default.conf
[root@Nagios-Server include]# vim /usr/local/apache2/conf/extra/httpd-default.conf
#ServerTokens Prod
#ServerSignature off
HTTP/1.1 200 OK
Date: Sun, 07 Dec 2014 11:55:51 GMT
Server: Apache/2.2.23 (Unix) PHP/5.4.1 #此处无法去掉,若要隐藏,只有用方法一
Last-Modified: Sat, 06
Dec 2014 07:22:37 GMT
ETag: "42760-19-509870ed29d1c" Accept-Ranges: bytes
Content-Length: 25
Content-Type: text/html
Apache rewrite 规则的配置
安装模块 mod_rewrite.so
修改 httpd.conf 文件开启 mode_rewrite.so
vim /etc/httpd/conf/httpd.conf
LoadModule rewrite_module modules/mod_rewrite.so ##检查确定开启此行
创建基于域名的虚拟主机
[root@localhost ~]# vim /etc/httpd/conf.d/vhosts.conf
<VirtualHost *:80>
ServerAdmin
hunk.test.com DocumentRoot "/var/www/html/hunk" ServerName 192.168.10.201
RewriteEngine on ##打开 rewirte 功能 Include conf.d/hunk-rewrite.conf
</VirtualHost>
写 rewrite 规则
[root@localhost ~]# vim /etc/httpd/conf.d/hunk-rewrite.conf
RewriteCond %{HTTP_HOST} hunk.test.com [NC]
RewriteRule
^(.*)/index.html$ http://hunk.test.com/test.html[L,R=302]
在/var/www/html/hunk 添加测试页面。
[root@localhost ~]# vim /var/www/html/hunk/index.html
<html>
<title>
test page
</title>
</head>
<body >
<p align="center">
<font size="32px" color="red">
this is test page !page jump failure!
</font>
</p>
</body>
</html>
[root@localhost ~]# vim /var/www/html/hunk/hunk.html
<html>
<head>
<title>
test page
</title>
</head>
<body >
<p align="center">
<font size="32px" color="red">
this
is test page !page jump success!
</font>
</p>
</body>
</html>
修改 hosts 文件
xp:C:\Windows\System32\drivers\etc\hosts
192.168.10.246 hunk.test.com ##添加此行
访问 hunk.test.com/index.html
this is test page !page jump success!
[root@localhost ~]# vim /etc/hosts
192.168.10.40 hunk.test.com
[root@localhost ~]# elinks --dump hunk.test.com/index.html
this is test page !page jump success!
注意事项
1.书写
rewrite 需要知道正则表达式的知识。
在 RewriteRule
^(.*)/index.html$
http://hunk.test.com/test.html[L,R=302]中,^表示以某 某开头,$表示以某某结尾, .(点)表示匹配任意单个字符,*表示匹配前面的子表达式零次或多次(大
于等于 0 次)
2.这里搭建的是基于域名的虚拟主机的 web
服务器,所以下面两行代码是在
/etc/httpd/conf.d/vhosts.conf 书写。说明是此服务器也就是 hunk.test.com 打开 rewrite 功能,
并应用规则。
RewriteEngine on ##打开
rewirte 功能
Include conf.d/hunk-rewrite.conf
如果不是基于虚拟主机的 web 服务器,上面两行需要在/etc/httpd/conf/httpd.conf 书写。
隐藏系统和 Apache 的版本信息的更多相关文章
- centos apache 隐藏和伪装 版本信息
1.隐藏Apache版本信息 测试默认 apache 的状态信息[root@1314it conf]# curl -Is localhostHTTP/1.1 200 OKDate: Tue, 16 N ...
- 查看nginx | apache | php | tengine | tomcat版本的信息以及如何隐藏版本信息【转】
转自: 查看nginx | apache | php | tengine | tomcat版本的信息以及如何隐藏版本信息 - 追马 - 51CTO技术博客http://lovelace.blog.51 ...
- The server of Apache (四)——配置防盗链和隐藏版本信息
一.防盗链 防盗链就是防止别人的网站代码里面盗用我们服务器的图片.文件.视频等相关资源,比如我们的网页的图片有链接,别人把链接复制粘贴到他们的服务器页面里,图片不在他们自己的网站里,每次打开他们的网站 ...
- linux,apache,mysql,php常用查看版本信息的方法
1. 查看linux的内核版本,系统信息,常用的有三种办法: uname -a; cat /proc/version; -bash-4.2$ uname -a Linux apphost -.el7. ...
- linux,apache,php,mysql常用的查看版本信息的方法
1. 查看linux的内核版本,系统信息,常用的有三种办法: uname -a: more /etc/issue; cat /proc/version; 2. 查看apache的版本信息 ...
- 在HTTP响应标题中隐藏ASP.NET MVC的版本
在默认情况下,ASP.NET MVC网站会在HTTP响应标题(Response Header)中动态添加目前使用的ASP.NET MVC版本编号.如果使用Fiddler Web Debugger工具查 ...
- nginx/apache/php隐藏http头部版本信息的实现方法
有时候我们需要隐藏我们的服务器版本信息,防止有心人士的研究,更安全,这里介绍下在nginx/apache/php中如何隐藏http头部版本信息的方法. nginx隐藏头部版本信息方法 编辑nginx. ...
- apache安全之修改或隐藏版本信息
修改apache版本信息 在安装之前,编辑原文件httpd-2.2.31/include/ap_release.h文件如下: 40 #define AP_SERVER_BASEVENDO ...
- apache、php隐藏http头部版本信息的实现方法
1.apache隐藏头部版本信息,编辑httpd.conf文件,找到: ServerTokens OS ServerSignature On 修改为: ServerTokens ProductOnly ...
随机推荐
- Spring Cloud Stream教程(二)主要概念
Spring Cloud Stream提供了一些简化了消息驱动的微服务应用程序编写的抽象和原语.本节概述了以下内容: Spring Cloud Stream的应用模型 Binder抽象 持续的发布 - ...
- C++二维数组(指针)做参数
一.问题描述 使用C++编程过程中经常需要使用到二维数组,然而初级程序员在使用过程中经常会出错使程序崩溃.下面就二维指针的定义,初始化,以及二维指针做参数给出简单介绍. 1.二维数组的定义与初始化 在 ...
- Oracle删除表空间报ORA01548
由于undo表空间设置了自动增长,导致替换了好几个undo表空间,就想把原先的undo表空间删掉腾出空间 但删的时候报错 SQL> drop tablespace undotbs1 includ ...
- 添加tomcat为启动服务/删除tomcat服务
在很多生产把环境下,tomcat的启动要随着windows的启动一起启动,这个时候就需要将tomcat添加成服务.步骤如下: 1:环境配置 配置jdk环境变量: JAVA_HOME:jdk路径 配置p ...
- nw.js node-webkit基本程序结构与配置package.json配置说明
(一)基本程序结构 如上图,是一个nw程序的基本组织结构,在根目录下有package.json(程序的配置文件)和index.html(可以是任意名称,应用的启动页面):js/css/resource ...
- 2018.03.27 pandas concat 和 combin_first使用
# 连接和修补concat.combine_first 沿轴的堆叠连接 # 连接concatimport pandas as pdimport numpy as np s1 = pd.Series([ ...
- Elasticsearch 安装head插件
一.简介 elasticsearch-head是一个界面化的集群操作和管理工具,可以对集群进行傻瓜式操作.你可以通过插件把它集成到es(首选方式),也可以安装成一个独立webapp. Elastics ...
- 别把&和nohup混为一谈, 根本不是同一个东西好不好 ------ 聊聊./a.out & , nohut ./a.out , nohup ./a.out &的区别
在第一家公司工作的时候, 我认识了&,在第二家公司工作的时候, 我认识了nohup, 这就是渊源. 随后, 我就一直糊涂用他们, 但并不懂这两个东西. 网上很多地方是乱扯, 瞎复制, 为什 ...
- element_to_be_clickable(locator)
是等待页面元素可见的时候操作,会设置一定范围的时间,如果在时间范围内,元素可见,就 执行操作,元素不可见,就会引发TimeoutException的异常.如下是element_to_be_clicka ...
- 第十届山东省acm省赛补题(2)
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4124 L Median Time Limit: 1 Second ...