本文共 1178 字,大约阅读时间需要 3 分钟。
安装pcre
安装apr ./configure make make install apache的安装 ./configure --with-included-apr --with-php --with-mysql --with-susexec --disable-info --with-mpm=prefork --enable-so --enable-cgi --enable-rewrite --enable-ssl --enable-mime-magic --enable-unique-id --enable-mods-shared=all --enable-ssl=shared --enable-proxy --enable-proxy-connect --enable-proxy-ftp --enable-proxy-http make make install 注意 不要指定--prefix=/app/apache,否则出现error: cannot install `libaprutil-1.la' to a directory not ending in /usr/local/apache2/lib 因为编译使用了shared modules,必须添加LoadModule authz_host_module modules/mod_authz_host.so,否则出现 Invalid command 'Order', perhaps misspelled or defined by a module not included in the server config验证apxs安装
/usr/local/apache2/bin/apxs -c -i 安装modsecurity 来源位置: ./configure --with-apxs=/usr/local/apache2/bin/apxs --with-pcre=/usr/local/bin/pcre-config --with-apr=/usr/local/apache2/bin/apr-1-config --with-apu=/usr/local/apache2/bin/apu-1-config make make install创建目录modsecurity
mkdir /usr/local/apache2/conf/modsecurity/ 修改httpd.conf 加入 LoadFile /usr/lib/libxml2.so LoadModule unique_id_module modules/mod_unique_id.so LoadModule security2_module modules/mod_security2.so转载地址:http://pihmb.baihongyu.com/