2016-02-04 99 views
1

1)我已经使用YAJL使用--with-yajl编译modsecurity,但是在配置日志中我看到没有选择yajl库并且在modsecurity日志中获得 “JSON支持是未启用”未启用JSON支持-ModSecurity

+0

即使使用--with-yajl ..在make文件后,我看到空值以下YAJL_CFLAGS = YAJL_LDADD = YAJL_LDFLAGS = YAJL_LIBS = –

回答

0

检查您的config.log如果它具有以下

checking for libyajl config script... no 
checking for yajl install... no 
configure: optional yajl library not found 

然后创建一个链接到yajl.pc作为

# ln -s /usr/local/share/pkgconfig/yajl.pc /usr/share/pkgconfig/yajl.pc 

在我的案件档案yajl.pc是在/ usr /本地/ share/pkgconfig/location。如果在那里找不到它,请尝试“find/-name yajl.pc”以找到它。

希望这可以帮助你。

1

我最初有mod_security和PHP 5.5和Apache 2.4一起使用Ubuntu 12.04,但在启用JSON请求检查后,我得到了与您报告相同的错误。

为了解决这个问题,我不得不使用yajl,使用yajl configure选项重新编译mod_security,然后确保Apache使用更新后的mod_security并重新启动Apache。

mod_security然后能够成功地解析json请求正文并且不再输出错误。


我去http://lloyd.github.io/yajl/,发现下载包yajl-2.1.0,然后提到https://gist.github.com/rpfilomeno/1140359f4bd360137a98

例如:

tar -xvzf lloyd-yajl-2.1.0-0-ga0ecdde.tar.gz cd lloyd-yajl-66cb08c/ sudo ./configure sudo make sudo make install sudo ldconfig 这应该安装yajl。然后cd与mod_security的文件的文件夹,然后运行

cd ../modsecurity-2.9.1/ sudo ./configure --with-yajl="/usr/local/lib /usr/local" sudo make sudo make install

我然后将其配置为与Apache 2.4运行,并且已经能够解析用JSON体的请求。

*请注意,在制作yajl时,如果未安装cmake相关的错误,请运行以下sudo apt-get install cmake,然后重试。