how can I install mod security?

hi
when i added them and then restart apache.i see this warning :
[root@server1 modsecurity2]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [Fri Mar 18 10:38:27 2011] [warn] module security2_module is already loaded, skipping
this warning mean that mod_security has been loaded before i add the lines in httpd-includes.conf
and when i see phpinfo i do not find loaded modules part compeletly
how i can see loaded modules part in phpinfo ?
i need see mod_Security in phpinfo
tnx
 
Try
Code:
httpd -l
if its in there, it must be compiled within apache or loaded in some other config.

try
Code:
cat /etc/httpd/extra/*.conf | grep mod_security
that'll tell you if it exists in one of the configs.
 
hi
when i try http -l
i dont see modsecurity
and when try
cat /etc/httpd/extra/*.conf | grep mod_security
i see this output :
cat: /etc/httpd/extra/*.conf: No such file or directory
and when i try
cat /etc/httpd/conf/extra/*.conf | grep mod_security

i dont see the output
and when i try

cat /etc/httpd/conf/*.conf | grep mod_security
i see this output :
[root@server1 conf]# cat /etc/httpd/conf/*.conf | grep mod_security
LoadModule security2_module /usr/lib/apache/mod_security2.so
<IfModule mod_security2.c>
------------
the last output mean modsecurity has been installed ?
if mod_security successfully installed please give me mod_Security log file place that i found which site has been attacked and mod_security blocked hacker query ( like sql injection and xxs )
tnx
 
Last edited:
Hello guys,

I was going through johnathanc (4th post of this thread) but I get the following error after running ./configure .
-bash: ./configure: No such file or directory

note: I downloaded mod_security 2.6.3 (latest stable version) and it seems this version has not any configure file in /apache2 directory !

Please guide me, what should I do?
 
Last edited:
The ./configure is now in the base directory instead of within apache2.

Once you do the ./configure in the base directory you can then navigate into the apache2 directory and do a make, and make install.

Interestingly enough when I run through these steps the module does not show up under:
httpd -l

Yet, the http error_log shows:
[Wed Jan 04 08:14:28 2012] [notice] ModSecurity for Apache/2.6.3 (http://www.modsecurity.org/) configured.
[Wed Jan 04 08:14:28 2012] [notice] ModSecurity: APR compiled version="1.4.5"; loaded version="1.4.5"
[Wed Jan 04 08:14:28 2012] [notice] ModSecurity: PCRE compiled version="8.21"; loaded version="8.21 2011-12-12"
[Wed Jan 04 08:14:28 2012] [notice] ModSecurity: LIBXML compiled version="2.7.6"


I have not yet determined if things are running properly yet or not. I need to do more testing to see. I would imagine it wouldn't be, but I'm kind of surprised I'd have a message stating that it was loaded...
 
Interestingly enough when I run through these steps the module does not show up under:
httpd -l

Yet, the http error_log shows:
[Wed Jan 04 08:14:28 2012] [notice] ModSecurity for Apache/2.6.3 (http://www.modsecurity.org/) configured.
[Wed Jan 04 08:14:28 2012] [notice] ModSecurity: APR compiled version="1.4.5"; loaded version="1.4.5"
[Wed Jan 04 08:14:28 2012] [notice] ModSecurity: PCRE compiled version="8.21"; loaded version="8.21 2011-12-12"
[Wed Jan 04 08:14:28 2012] [notice] ModSecurity: LIBXML compiled version="2.7.6"

Got the same situation. I dont have it listed in phpinfo() output. I passed the step "--with-mod_security2". I dont get it, why should I compile it into apache instead of loading it as module?
 
That command will only show the modules that have been compiled as part of Apache. If you've configured mod_sec properly, you should check out its log file. IT should reveal plenty of false positives that you'll need to deal with.
 
Ok, thanks for that info. I had empty logs because I forgot about
Code:
SecRuleEngine On
;)
 
Got the same situation. I dont have it listed in phpinfo() output. I passed the step "--with-mod_security2". I dont get it, why should I compile it into apache instead of loading it as module?
Can anyone answer this cause I feel the same :) Is it needed to compile it in too if it's loaded as a module already?
 
Last edited:
Hello;

I am getting this error when i try to install it. My configuration is CB 1.2 - PHP 5.2 - Apache 2.4.1

Error ;


mod_security2.c:1118: warning: passing argument 1 of 'ap_hook_error_log' from in compatible pointer type
/usr/include/apache/http_core.h:888: note: expected 'void (*)(const struct ap_er rorlog_info *, const char *)' but argument is of type 'void (*)(const char *, in t, int, apr_status_t, const struct server_rec *, const struct request_rec *, struct apr_pool_t *, const char *)'
apxs:Error: Command failed with rc=65536
.
make: *** [mod_security2.la] Error 1
 
I install mod_security as in the toturial in this thread on centOS 6
After install httpd won't start anymore

DA error

An error has occurred


Details

/sbin/service httpd start 2>&1



Apache says that it can't load the module /usr/lib/apache/mod_security2.so can't find the module in this dir

What did I do wrong? There are no security2 modules in this dir
 
Last edited:
Back
Top