ningx配置ModSecurity重启出现兼容性问题:ModSecurity: Loaded PCRE do not match with compiled!的解决方法
nginx开启错误日志,然后重启nginx,出现如下信息:
2016/12/03 09:40:38 [notice] 18858#0: ModSecurity for nginx (STABLE)/2.9.1 (http://www.modsecurity.org/) configured.
2016/12/03 09:40:38 [notice] 18858#0: ModSecurity: APR compiled version="1.4.8"; loaded version="1.4.8"
2016/12/03 09:40:38 [notice] 18858#0: ModSecurity: PCRE compiled version="8.39 "; loaded version="8.32 2012-11-30"
2016/12/03 09:40:38 [warn] 18858#0: ModSecurity: Loaded PCRE do not match with compiled!
2016/12/03 09:40:38 [notice] 18858#0: ModSecurity: LIBXML compiled version="2.9.1"
2016/12/03 09:40:38 [notice] 18858#0: ModSecurity: StatusEngine call: "2.9.1,nginx,1.4.8/1.4.8,8.39/8.32 2012-11-30,(null),2.9.1,1041d4bc04a4b99eb3aab2c7d5ad7bbeb72f7b5b"
2016/12/03 09:40:38 [notice] 18858#0: ModSecurity: StatusEngine call successfully sent. For more information visit: http://status.modsecurity.org/
注意红色字体部分就是兼容性的错误提示:
要求PCRE的软件版本是8.39,系统加载的是软件版本是8.32,所以更新PCRE软件版本到8.39即可解决这个问题。
那么问题来了
通过/usr/local/nginx/sbin/nginx -V 查看nginx的编译参数,PCRE的软件版本是8.39
nginx version: nginx/1.10.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)
built with OpenSSL 1.0.2j 26 Sep 2016
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --without-http_memcached_module --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-openssl=/usr/local/src/openssl-1.0.2j --with-zlib=/usr/local/src/zlib-1.2.8 --with-pcre=/usr/local/src/pcre-8.39 --add-module=/usr/local/src/modsecurity-2.9.1/nginx/modsecurity
也就是说在安装nginx的时候已经安装pcre8.39软件版本了,但是看系统上的pcre软件版本却不是8.39,还是系统本身自带的软件版本8.32,具体查看如下:
# rpm -qa | grep pcre
pcre-devel-8.32-15.el7_2.1.x86_64
pcre-8.32-15.el7_2.1.x86_64
# pcre-config --version
8.32
解决方法:
1、查看系统安装的pcre软件
#rpm -qa | grep pcre
pcre-devel-8.32-15.el7_2.1.x86_64
pcre-8.32-15.el7_2.1.x86_64
2、系统自带的千万别卸载,直接源码安装最新的就行
3、下载pcre.39源码进行安装
wget http://ftp.exim.llorien.org/pcre/pcre-8.39.tar.gz
tar zxvf pcre-8.39.tar.gz
cd pcre-8.39
./configure --prefix=/usr --docdir=/usr/share/doc/pcre-8.39 --libdir=/usr/lib64 --enable-unicode-properties --enable-pcre16 --enable-pcre32 --enable-pcregrep-libz --enable-pcregrep-libbz2 --disable-static --enable-utf8 --enable-shared
make && make install
然后重启nginx,则不会出现ModSecurity兼容性显示,nginx错误日志如下显示:
2016/12/03 10:09:50 [notice] 28116#0: ModSecurity for nginx (STABLE)/2.9.1 (http://www.modsecurity.org/) configured.
2016/12/03 10:09:50 [notice] 28116#0: ModSecurity: APR compiled version="1.4.8"; loaded version="1.4.8"
2016/12/03 10:09:50 [notice] 28116#0: ModSecurity: PCRE compiled version="8.39 "; loaded version="8.39 2016-06-14"
2016/12/03 10:09:50 [notice] 28116#0: ModSecurity: LIBXML compiled version="2.9.1"
2016/12/03 10:09:50 [notice] 28116#0: ModSecurity: StatusEngine call: "2.9.1,nginx,1.4.8/1.4.8,8.39/8.39 2016-06-14,(null),2.9.1,1041d4bc04a4b99eb3aab2c7d5ad7bbeb72f7b5b"
2016/12/03 10:09:50 [notice] 28116#0: ModSecurity: StatusEngine call successfully sent. For more information visit: http://status.modsecurity.org/
查看pcre软件版本:
#rpm -qa | grep pcre (系统自带的未卸载,还会有信息显示出来)
pcre-devel-8.32-15.el7_2.1.x86_64
pcre-8.32-15.el7_2.1.x86_64
#pcre-config --version (查看到软件版本是8.39)
8.39
#pcretest -C (换个命令查看还是8.39)
PCRE version 8.39 2016-06-14
Compiled with
8-bit support
UTF-8 support
16-bit support
UTF-16 support
32-bit support
UTF-32 support
Unicode properties support
No just-in-time compiler support
Newline sequence is LF
\R matches all Unicode newlines
Internal link size = 2
POSIX malloc threshold = 10
Parentheses nest limit = 250
Default match limit = 10000000
Default recursion depth limit = 10000000
Match recursion uses stack
# ldconfig -v | grep pcre
ldconfig: 无法对 /libx32 进行 stat 操作: 没有那个文件或目录
ldconfig: 多次给出路径“/usr/lib”
ldconfig: 多次给出路径“/usr/lib64”
ldconfig: 无法对 /usr/libx32 进行 stat 操作: 没有那个文件或目录
libpcreposix.so.0 -> libpcreposix.so.0.0.4
libpcrecpp.so.0 -> libpcrecpp.so.0.0.1
libpcre32.so.0 -> libpcre32.so.0.0.7
libpcre16.so.0 -> libpcre16.so.0.2.7
libpcre.so.1 -> libpcre.so.1.2.7
ningx配置ModSecurity重启出现兼容性问题:ModSecurity: Loaded PCRE do not match with compiled!的解决方法的更多相关文章
- WPF:指定的命名连接在配置中找不到、非计划用于 EntityClient 提供程序或者无效的解决方法
文/嶽永鹏 WPF 数据绑定中绑定到ENTITY,如果把数据文件做成一个类库,在UI文件中去应用它,可能遇到下面这种情况. 指定的命名连接在配置中找不到.非计划用于 EntityClient 提供程序 ...
- 配置server.xml后,启动tomcat 失败(Unable to start cluster)及解决方法
在配置负载均衡环境过程中修改server.xml 后重启tomcat报错,报错信息如下 [root@Alice bin]# ./catalina.sh runUsing CATALINA_BASE: ...
- 配置webstorm使用supervisor时出现 /usr/bin/env: node: 没有那个文件或目录 解决方法
配置好supervisor路径后 出现了 启动时出现了 /usr/bin/env: node: 没有那个文件或目录 需要讲.nvm下的node链接到, /usr/bin/目录下 sudo ln -s ...
- 在 ServiceModel 客户端配置部分中,找不到引用协定“XX”的默认终结点元素的解决方法
今天在CRM2011中写Plugin的的时调用WCF报错,错误如下:"在 ServiceModel 客户端配置部分中,找不到引用协定"XX"的默认终结点元素.这可能是因为 ...
- VS2010 永久配置OpenCv2.4.9 及转换到COFF 期间失败:文件无效或损坏,解决方法
1.下载OpenCv2.4.9(win pack):http://opencv.org/releases.html 下载完成后,进行解压(win7 64位系统) 2.环境配置,配置如下图所示: 找到p ...
- .Net 配置 swagger 使用nginx反向代理后请求带端口号导致无法正常访问---解决方法
1 webconfig中 appsetting 中增加配置 <appSettings> <add key="aspnet:UseHostHeaderForRequestUr ...
- TP5动态路由配置好了但是报错was not found on this server的原因以及解决方法
问题:The requested URL /xxxx.html was not found on this server 原因:apache的重写未开启,开启重写后,问题解决, 方法如下: apach ...
- Linux/CentOS 配置Mysql-server过程和遇到错误解决方法
第一步:下载mysql-server 方法1.wget url(你所要下载的链接,可以从mysq官网查找)到当前目录下 方法2.到mysql官网下载包之后通过xftp传到linux 第二步:解压tar ...
- docker+mysql 更改配置后重启不了的解决方案
docker+mysql 更改配置后重启不了的解决方案 前提:在最近的项目中,决定将项目改造成数据库读写分离的架构,于是擅自更改生产环境的数据库的配置文件my.cnf,由于我是用docker进行部署的 ...
随机推荐
- Swift 3 新特性
原文:What's New in Swift 3? ,作者:Ben Morrow,译者:kmyhy Swift 3将于今年下半年推出,为Swift开发者们带来了很多核心代码的改变.如果你没有关注过 S ...
- 替换GitBlit的证书为域证书
GitBlit(当前版本1.6.2,http://gitblit.org/) 是一个Git版本控制的服务端,使用java编写,功能上足够满足基本的版本控制要求,而且部署很简单方便,比如windows上 ...
- 【Xamarin报错】AndroidManifest.xml : warning XA0101: @(Content) build action is not supported
部署xamarin.forms android时报错: Android\Properties\AndroidManifest.xml : warning XA0101: @(Content) buil ...
- DevExpress.XtraGrid winform试用分享
DevExpress.XtraGrid在winform里使用还挺麻烦,为了减少重复代码和代码复用,本人针对DevExpress.XtraGrid封装了一个Form的基类,其中涵盖了DevExpress ...
- XPS 15 9530使用Windows10频繁发生Intel HD Graphics 4600驱动奔溃的一种解决方法
本人使用XPS 15 9530.集成显卡为Intel HD Graphics 4600.操作系统Windows 10 Pro,使用过程当中经常会发生集成显卡奔溃的问题,错误提示如下: Display ...
- ARM Linux 3.x的设备树(Device Tree)
1. ARM Device Tree起源 Linus Torvalds在2011年3月17日的ARM Linux邮件列表宣称“this whole ARM thing is a f*cking pai ...
- 使用的 SQL Server 版本不支持数据类型“datetime2”的错误解决方法
THE VERSION OF SQL IN USE DOES NOT SUPPORT DATATYPE ‘DATETIME2′ 主要错误原因,在使用ado.net entity的时候,entity使用 ...
- 编写高质量JS代码的68个有效方法(十三)
No.61.不要阻塞I/O事件队列 Tips: 异步API使用回调函数来延缓处理代价高昂的操作以避免阻塞主应用程序 JavaScript并发的接收事件,但会使用一个事件队列按序地处理事件处理程序 在应 ...
- MongoDB 基础命令行
本文专门介绍MongoDB的命令行操作.其实,这些操作在MongoDB官网提供的Quick Reference上都有,但是英文的,为了方便,这里将其稍微整理下,方便查阅. 登录和退出 mongo命令直 ...
- [Node.js] Cluster,把多核用起来
原文地址: http://www.moye.me/?p=496 引子 众所周知,虽然Node的底层有一个IO线程池,但其应用层默认是单线程运行的,对于多核CPU环境来说,是一种资源的浪费. 所幸Nod ...