Cannot load /usr/local/libexec/apache22/mod_security2.so into server

时间:2019-11-20 08:53:58  来源:igfitidea点击:

在FreeBSD中重启apach22进程时报错:

Performing sanity check on apache22 configuration:  
httpd: Syntax error on line 106 of /usr/local/etc/apache22/httpd.conf: 
Cannot load /usr/local/libexec/apache22/mod_security2.so into server: /usr/local/libexec/apache22/mod_security2.so: 
Undefined symbol xmlFree

解决方案

确保运行的是Apache和mod_security更新版本。

编辑配置文件httpd.conf:

vi /usr/local/etc/apache22/httpd.conf

找到下面的行:

LoadModule security2_module   libexec/apache22/mod_security2.so

在它前面添加一行,如下所示:

LoadFile /usr/local/lib/libxml2.so
LoadModule security2_module   libexec/apache22/mod_security2.so

重启Apache:

# /usr/local/etc/rc.d/apache22 restart