<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: Red Hat / CentOS Install mod_security Apache Intrusion Detection And Prevention Engine</title> <atom:link href="http://www.cyberciti.biz/faq/rhel-fedora-centos-httpd-mod_security-configuration/feed/" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/faq/rhel-fedora-centos-httpd-mod_security-configuration/</link> <description>Every answer asks a more beautiful question.</description> <lastBuildDate>Fri, 10 Feb 2012 19:55:56 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Bri</title><link>http://www.cyberciti.biz/faq/rhel-fedora-centos-httpd-mod_security-configuration/#comment-60518</link> <dc:creator>Bri</dc:creator> <pubDate>Wed, 06 Jul 2011 17:32:37 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=3770#comment-60518</guid> <description>Installing lua from here fixes this if your running Centos 5.5
http://pkgs.org/download/centos-5-rhel-5/atomic-x86_64/lua-5.1.4-1.el5.art.x86_64.rpm.html</description> <content:encoded><![CDATA[<p>Installing lua from here fixes this if your running Centos 5.5</p><p><a
href="http://pkgs.org/download/centos-5-rhel-5/atomic-x86_64/lua-5.1.4-1.el5.art.x86_64.rpm.html" rel="nofollow">http://pkgs.org/download/centos-5-rhel-5/atomic-x86_64/lua-5.1.4-1.el5.art.x86_64.rpm.html</a></p> ]]></content:encoded> </item> <item><title>By: Djemo</title><link>http://www.cyberciti.biz/faq/rhel-fedora-centos-httpd-mod_security-configuration/#comment-51052</link> <dc:creator>Djemo</dc:creator> <pubDate>Mon, 22 Nov 2010 20:00:08 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=3770#comment-51052</guid> <description>i finally figure out my problem setting up mod_security with compiled httpd
skip step 2. and on step 6 use pcre from httpd source:
./configure –with-apxs=/usr/sbin/apxs –with-apr=/usr/local/apr/bin/apr-1-config –with-apu=/usr/bin/apu-1-config --with-pcre=/path/to/apache-src/srclib/pcre
httpd doesn&#039;t get stuck ant it works.</description> <content:encoded><![CDATA[<p>i finally figure out my problem setting up mod_security with compiled httpd</p><p>skip step 2. and on step 6 use pcre from httpd source:</p><p>./configure –with-apxs=/usr/sbin/apxs –with-apr=/usr/local/apr/bin/apr-1-config –with-apu=/usr/bin/apu-1-config &#8211;with-pcre=/path/to/apache-src/srclib/pcre</p><p>httpd doesn&#8217;t get stuck ant it works.</p> ]]></content:encoded> </item> <item><title>By: Djemo</title><link>http://www.cyberciti.biz/faq/rhel-fedora-centos-httpd-mod_security-configuration/#comment-50261</link> <dc:creator>Djemo</dc:creator> <pubDate>Thu, 21 Oct 2010 14:17:05 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=3770#comment-50261</guid> <description>I have a trouble setting mod_security from source with httpd from source on CentOS 5.5. I was able to setup mod_security from source and httpd from rpm without problems and on FreeBSD 8.1 both from source (not ports) without problems.
On CentOS  setting from source, when I restart apache I get
ModSecurity for Apache/2.5.12 (http://www.modsecurity.org/) configured, and httpd starts.
As soon as I add:
Include conf/modsecurity_crs_10_config.conf in httpd.conf and restart httpd, is stuck on restarting (or starting if it&#039;s not running already)  and it takes 100% CPU.
The &quot;modsecurity_crs_10_config.conf&quot; is original, and I setup everything like FreeBSD which works.
Here are the steps I created and use
to setup mod_security and they are based on requirements from mod_security site:
--Installation
0. Make sure mod_unique_id is loaded/included in httpd
compile httpd with enable-unique-id
or load module for rpm based httpd
LoadModule unique_id_module modules/mod_unique_id.so
1. Download APR form Apache.org
./configure --prefix=/usr/local/apr
make
make install
2. Download PCRE from pcre.org
./configure --prefix=/usr/local/pcre
make
make install
3. make sure you have libxml2 installed on computer (On CENTOS5 comes by default) otherwise install it
4. Download Lua libs from from http://luabinaries.sourceforge.net/
mkdir lualibs
cd lualibs
wget http://sourceforge.net/projects/luabinaries/files/5.1.4/Linux%20Libraries/lua5_1_4_Linux26_lib.tar.gz/download for 32bit
wget http://sourceforge.net/projects/luabinaries/files/5.1.4/Linux%20Libraries/lua5_1_4_Linux26_64_lib.tar.gz/download for 64 bit
cp * liblua* /usr/local/lib64
cp include/* /usr/include
5. make sure you have curl -v 7.15.1+
6. Download modsecurity from modsecurity.org (make sure you have httpd-devel package if httpd is from  RPM or not compiled with-apxs from source)
./configure --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apr/bin/apr-1-config --with-apu=/usr/local/apache2/bin/apu-1-config --with-
pcre=/usr/local/pcre/bin/pcre-config  (HTTPD from source)
./configure --with-apxs=/usr/sbin/apxs --with-apr=/usr/local/apr/bin/apr-1-config --with-apu=/usr/bin/apu-1-config --with-pcre=/usr/local/pcre/bin/pcre-
config        (HTTPD from RPM for CentOS 5)
make
make install
--Configuration
7. Edit httpd.conf file to include the following:
LoadFile /usr/lib64/libxml2.so
LoadFile /usr/lib64/liblua5.1.so
LoadModule security2_module modules/mod_security2.so
--Testing
8. Check is modsecurity installed by stoping and starting httpd and checking httpd error logs.
--Applying Atomic Mod Security Rules
9. mkdir rules
cd rules
wget http://downloads.prometheus-group.com/delayed/rules/modsec-201002051427.tar.gz
tar -zxvf modsec-201002051427.tar.gz
cd ..
mv rules /etc/httpd/conf
10. Create following directories:
mkdir /var/asl
mkdir /var/asl/tmp
mkdir /var/asl/data
mkdir /var/asl/data/msa
mkdir /var/asl/data/audit
mkdir /var/asl/data/suspicious
mkdir /etc/asl
touch /etc/asl/whitelist
11. Add this on httpd.conf
Include conf/modsecurity_crs_10_config.conf
Include conf/rules/*asl*.conf
12. Create conf/modsecurity_crs_10_config.conf file:
SecRuleEngine On
SecRequestBodyAccess On
SecResponseBodyAccess On
SecResponseBodyMimeType (null) text/html text/plain text/xml
SecResponseBodyLimit 2621440
SecServerSignature Apache
SecComponentSignature 200911012341
SecUploadDir /var/asl/data/suspicious
SecUploadKeepFiles Off
SecAuditEngine RelevantOnly
SecAuditLogRelevantStatus &quot;^(?:5&#124;4(?!04))&quot;
SecAuditLogType Concurrent
SecAuditLog logs/audit_log
SecAuditLogParts ABIFHZ
SecArgumentSeparator &quot;&amp;&quot;
SecCookieFormat 0
SecRequestBodyInMemoryLimit 131072
SecDataDir /var/asl/data/msa
SecTmpDir /tmp
SecAuditLogStorageDir /var/asl/data/audit
SecResponseBodyLimitAction ProcessPartial
13. Restart httpd server
-- Testing Mod_security and Atomic rules
14. Test with webserver scanning tool like Nikto
Check the httpd audit log and error logs does evrything work.
--End
I am wondering did anyone have this problem, and how did they solve it. I tried on few machines, and with same problem.
Thanks</description> <content:encoded><![CDATA[<p>I have a trouble setting mod_security from source with httpd from source on CentOS 5.5. I was able to setup mod_security from source and httpd from rpm without problems and on FreeBSD 8.1 both from source (not ports) without problems.</p><p>On CentOS  setting from source, when I restart apache I get<br
/> ModSecurity for Apache/2.5.12 (<a
href="http://www.modsecurity.org/" rel="nofollow">http://www.modsecurity.org/</a>) configured, and httpd starts.<br
/> As soon as I add:<br
/> Include conf/modsecurity_crs_10_config.conf in httpd.conf and restart httpd, is stuck on restarting (or starting if it&#8217;s not running already)  and it takes 100% CPU.</p><p>The &#8220;modsecurity_crs_10_config.conf&#8221; is original, and I setup everything like FreeBSD which works.</p><p>Here are the steps I created and use<br
/> to setup mod_security and they are based on requirements from mod_security site:</p><p>&#8211;Installation</p><p>0. Make sure mod_unique_id is loaded/included in httpd<br
/> compile httpd with enable-unique-id</p><p>or load module for rpm based httpd</p><p>LoadModule unique_id_module modules/mod_unique_id.so</p><p>1. Download APR form Apache.org</p><p>./configure &#8211;prefix=/usr/local/apr<br
/> make<br
/> make install</p><p>2. Download PCRE from pcre.org</p><p>./configure &#8211;prefix=/usr/local/pcre<br
/> make<br
/> make install</p><p>3. make sure you have libxml2 installed on computer (On CENTOS5 comes by default) otherwise install it</p><p>4. Download Lua libs from from <a
href="http://luabinaries.sourceforge.net/" rel="nofollow">http://luabinaries.sourceforge.net/</a><br
/> mkdir lualibs<br
/> cd lualibs<br
/> wget <a
href="http://sourceforge.net/projects/luabinaries/files/5.1.4/Linux%20Libraries/lua5_1_4_Linux26_lib.tar.gz/download" rel="nofollow">http://sourceforge.net/projects/luabinaries/files/5.1.4/Linux%20Libraries/lua5_1_4_Linux26_lib.tar.gz/download</a> for 32bit<br
/> wget <a
href="http://sourceforge.net/projects/luabinaries/files/5.1.4/Linux%20Libraries/lua5_1_4_Linux26_64_lib.tar.gz/download" rel="nofollow">http://sourceforge.net/projects/luabinaries/files/5.1.4/Linux%20Libraries/lua5_1_4_Linux26_64_lib.tar.gz/download</a> for 64 bit<br
/> cp * liblua* /usr/local/lib64<br
/> cp include/* /usr/include</p><p>5. make sure you have curl -v 7.15.1+</p><p>6. Download modsecurity from modsecurity.org (make sure you have httpd-devel package if httpd is from  RPM or not compiled with-apxs from source)</p><p> ./configure &#8211;with-apxs=/usr/local/apache2/bin/apxs &#8211;with-apr=/usr/local/apr/bin/apr-1-config &#8211;with-apu=/usr/local/apache2/bin/apu-1-config &#8211;with-</p><p>pcre=/usr/local/pcre/bin/pcre-config  (HTTPD from source)</p><p> ./configure &#8211;with-apxs=/usr/sbin/apxs &#8211;with-apr=/usr/local/apr/bin/apr-1-config &#8211;with-apu=/usr/bin/apu-1-config &#8211;with-pcre=/usr/local/pcre/bin/pcre-</p><p>config        (HTTPD from RPM for CentOS 5)</p><p>make<br
/> make install</p><p>&#8211;Configuration</p><p>7. Edit httpd.conf file to include the following:<br
/> LoadFile /usr/lib64/libxml2.so<br
/> LoadFile /usr/lib64/liblua5.1.so<br
/> LoadModule security2_module modules/mod_security2.so</p><p>&#8211;Testing</p><p>8. Check is modsecurity installed by stoping and starting httpd and checking httpd error logs.</p><p>&#8211;Applying Atomic Mod Security Rules</p><p>9. mkdir rules<br
/> cd rules<br
/> wget <a
href="http://downloads.prometheus-group.com/delayed/rules/modsec-201002051427.tar.gz" rel="nofollow">http://downloads.prometheus-group.com/delayed/rules/modsec-201002051427.tar.gz</a><br
/> tar -zxvf modsec-201002051427.tar.gz<br
/> cd ..<br
/> mv rules /etc/httpd/conf</p><p>10. Create following directories:<br
/> mkdir /var/asl<br
/> mkdir /var/asl/tmp<br
/> mkdir /var/asl/data<br
/> mkdir /var/asl/data/msa<br
/> mkdir /var/asl/data/audit<br
/> mkdir /var/asl/data/suspicious<br
/> mkdir /etc/asl<br
/> touch /etc/asl/whitelist</p><p>11. Add this on httpd.conf</p><p> Include conf/modsecurity_crs_10_config.conf<br
/> Include conf/rules/*asl*.conf</p><p>12. Create conf/modsecurity_crs_10_config.conf file:</p><p> SecRuleEngine On<br
/> SecRequestBodyAccess On<br
/> SecResponseBodyAccess On<br
/> SecResponseBodyMimeType (null) text/html text/plain text/xml<br
/> SecResponseBodyLimit 2621440<br
/> SecServerSignature Apache<br
/> SecComponentSignature 200911012341<br
/> SecUploadDir /var/asl/data/suspicious<br
/> SecUploadKeepFiles Off<br
/> SecAuditEngine RelevantOnly<br
/> SecAuditLogRelevantStatus &#8220;^(?:5|4(?!04))&#8221;<br
/> SecAuditLogType Concurrent<br
/> SecAuditLog logs/audit_log<br
/> SecAuditLogParts ABIFHZ<br
/> SecArgumentSeparator &#8220;&amp;&#8221;<br
/> SecCookieFormat 0<br
/> SecRequestBodyInMemoryLimit 131072<br
/> SecDataDir /var/asl/data/msa<br
/> SecTmpDir /tmp<br
/> SecAuditLogStorageDir /var/asl/data/audit<br
/> SecResponseBodyLimitAction ProcessPartial</p><p>13. Restart httpd server</p><p>&#8211; Testing Mod_security and Atomic rules</p><p>14. Test with webserver scanning tool like Nikto<br
/> Check the httpd audit log and error logs does evrything work.</p><p>&#8211;End<br
/> I am wondering did anyone have this problem, and how did they solve it. I tried on few machines, and with same problem.</p><p>Thanks</p> ]]></content:encoded> </item> <item><title>By: mct</title><link>http://www.cyberciti.biz/faq/rhel-fedora-centos-httpd-mod_security-configuration/#comment-46338</link> <dc:creator>mct</dc:creator> <pubDate>Wed, 10 Mar 2010 22:00:14 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=3770#comment-46338</guid> <description>thx. hooked me up.</description> <content:encoded><![CDATA[<p>thx. hooked me up.</p> ]]></content:encoded> </item> <item><title>By: math</title><link>http://www.cyberciti.biz/faq/rhel-fedora-centos-httpd-mod_security-configuration/#comment-46300</link> <dc:creator>math</dc:creator> <pubDate>Tue, 09 Mar 2010 11:45:52 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=3770#comment-46300</guid> <description>thank you very much for tutorial
but after install mod_security - all  Jquery stop to load!!
I think that mod_security conflict with jquery files loaded from local server
plesae how to fix this issue?
best regards</description> <content:encoded><![CDATA[<p>thank you very much for tutorial<br
/> but after install mod_security &#8211; all  Jquery stop to load!!<br
/> I think that mod_security conflict with jquery files loaded from local server<br
/> plesae how to fix this issue?<br
/> best regards</p> ]]></content:encoded> </item> <item><title>By: Vivek Gite</title><link>http://www.cyberciti.biz/faq/rhel-fedora-centos-httpd-mod_security-configuration/#comment-45782</link> <dc:creator>Vivek Gite</dc:creator> <pubDate>Mon, 01 Feb 2010 10:49:06 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=3770#comment-45782</guid> <description>@Bob,
See /etc/httpd/conf.d/mod_security.conf</description> <content:encoded><![CDATA[<p>@Bob,</p><p>See /etc/httpd/conf.d/mod_security.conf</p> ]]></content:encoded> </item> <item><title>By: Bob</title><link>http://www.cyberciti.biz/faq/rhel-fedora-centos-httpd-mod_security-configuration/#comment-45780</link> <dc:creator>Bob</dc:creator> <pubDate>Mon, 01 Feb 2010 07:26:11 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=3770#comment-45780</guid> <description>Thank you for the RPM but I noticed that no entry was made to httpd.conf (LoadModule), and that the installation is substantially different than installing by compiling from the source. I&#039;m not an advanced Admin and wonder if I have missed something. I also don&#039;t see in error_log that mod_sec was installed.</description> <content:encoded><![CDATA[<p>Thank you for the RPM but I noticed that no entry was made to httpd.conf (LoadModule), and that the installation is substantially different than installing by compiling from the source. I&#8217;m not an advanced Admin and wonder if I have missed something. I also don&#8217;t see in error_log that mod_sec was installed.</p> ]]></content:encoded> </item> <item><title>By: pgl</title><link>http://www.cyberciti.biz/faq/rhel-fedora-centos-httpd-mod_security-configuration/#comment-45690</link> <dc:creator>pgl</dc:creator> <pubDate>Tue, 26 Jan 2010 16:40:39 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=3770#comment-45690</guid> <description>@Zigzacom: thanks for that!</description> <content:encoded><![CDATA[<p>@Zigzacom: thanks for that!</p> ]]></content:encoded> </item> <item><title>By: Zigzacom</title><link>http://www.cyberciti.biz/faq/rhel-fedora-centos-httpd-mod_security-configuration/#comment-42475</link> <dc:creator>Zigzacom</dc:creator> <pubDate>Sat, 11 Jul 2009 04:03:24 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=3770#comment-42475</guid> <description>With CentOS 5.3 it was a bit of an adventure, as mod_security from EPEL was looking for liblua-5.1.so, (a dependency), but one of the CentOS repos only has &quot;lua-5.0&quot;, and I had set CentOS repos to a higher priority than the EPEL repo.
I did an &quot;rpm -ivh http://mirrors.kernel.org/fedora-epel/5Server/x86_64/lua-5.1.2-1.el5.x86_64.rpm&quot;, then &quot;yum install mod_security&quot; and all was OK.
&quot;yum-priorities&quot; is a bit tricky with EPEL enabled. Disable the EPEL repo after you are done with installing mod_security or at least make sure you have the priorities set right.</description> <content:encoded><![CDATA[<p>With CentOS 5.3 it was a bit of an adventure, as mod_security from EPEL was looking for liblua-5.1.so, (a dependency), but one of the CentOS repos only has &#8220;lua-5.0&#8243;, and I had set CentOS repos to a higher priority than the EPEL repo.<br
/> I did an &#8220;rpm -ivh <a
href="http://mirrors.kernel.org/fedora-epel/5Server/x86_64/lua-5.1.2-1.el5.x86_64.rpm" rel="nofollow">http://mirrors.kernel.org/fedora-epel/5Server/x86_64/lua-5.1.2-1.el5.x86_64.rpm</a>&#8220;, then &#8220;yum install mod_security&#8221; and all was OK.</p><p>&#8220;yum-priorities&#8221; is a bit tricky with EPEL enabled. Disable the EPEL repo after you are done with installing mod_security or at least make sure you have the priorities set right.</p> ]]></content:encoded> </item> <item><title>By: bitt</title><link>http://www.cyberciti.biz/faq/rhel-fedora-centos-httpd-mod_security-configuration/#comment-41981</link> <dc:creator>bitt</dc:creator> <pubDate>Tue, 09 Jun 2009 21:41:49 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=3770#comment-41981</guid> <description>thx for this, very helpful.</description> <content:encoded><![CDATA[<p>thx for this, very helpful.</p> ]]></content:encoded> </item> <item><title>By: n3os</title><link>http://www.cyberciti.biz/faq/rhel-fedora-centos-httpd-mod_security-configuration/#comment-41583</link> <dc:creator>n3os</dc:creator> <pubDate>Wed, 13 May 2009 02:26:36 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=3770#comment-41583</guid> <description>now i found the article about CentOS Install mod_security, thx !!!</description> <content:encoded><![CDATA[<p>now i found the article about CentOS Install mod_security, thx !!!</p> ]]></content:encoded> </item> </channel> </rss>
