how to install Mod_Security

Cyber-DL

Active Member
#1
Hi everyone ,

i'm installed Trial Version OF LiteSpeed Enterprise Edition and i want install Mod_security 2.5.x , it's important for me to install Mod_security ,

is this possible ? if yes i'll buy a License !

Best Regards
 

-KaaL-

Active Member
#2
I think you are on DA ..

Try searching for "update.script" by HOWTO on directadmin.com site.
You should be fine :)

However you will get some errors. Post them here, i'll let you know how to correct them.
 

Cyber-DL

Active Member
#3
I think you are on DA ..

Try searching for "update.script" by HOWTO on directadmin.com site.
You should be fine :)

However you will get some errors. Post them here, i'll let you know how to correct them.
Yes, i'm using DA , but before i install LiteSpeed i Used Apache & i installed Mod_Security by Update.Script , BUT now in php.ini i can't see Mod_security, so i think it needed FreshInstall & Compiled with LiteSpeed !

Note : i didn't found php.ini IN /usr/local/lsws/lsphp5/lib , so i was copy php.ini that located in /usr/local/lib/php.ini to /usr/local/lsws/lsphp5/lib !

is this correct ?!

Best Regards
 

-KaaL-

Active Member
#4
At the time of Compiling PHP,

in "Install Path Prefix" put >> /usr/local/lsws/lsphp5

now put the php.ini file from your apache into this folder >> /usr/local/lsws/lsphp5

Start compiling PHP... you should be fine..
 

Cyber-DL

Active Member
#5
At the time of Compiling PHP,

in "Install Path Prefix" put >> /usr/local/lsws/lsphp5

now put the php.ini file from your apache into this folder >> /usr/local/lsws/lsphp5

Start compiling PHP... you should be fine..
and for installing Mod_security , how i do it ? i think mod_sec installed when i see it in PHPINFO.php ! ??? is this work!?
 

-KaaL-

Active Member
#6
Have you successfully installed mod_sec in your APACHE ?

If yes, then if you copy the APACHE php.ini file to the folder i told you above, simply compile php and Mod_sec should also work with litespeed.
 

Cyber-DL

Active Member
#7
thank's Kaal ,

yes i installed successfully mod_sec in APACHE , for installing i used Update.Script ,

now what's commands of Compile MOd_sec !?

can you tell which commands needed ? i don't know how can i compile & install Mod_sec!
 

Cyber-DL

Active Member
#10
i said i installed Mod_Sec by Update.Scrip , so mod_Sec file loaded in
Code:
nano -w /etc/httpd/conf/extra/httpd-includes.conf
this is installation steps :

Code:
nano -w /etc/httpd/conf/extra/httpd-includes.conf

64bit :
LoadFile /usr/lib64/libxml2.so
LoadModule security2_module     /usr/lib/apache/mod_security2.so
<IfModule mod_security2.c>
# ModSecurity2 ONLY
# Do not change anything in included files
#
Include /etc/modsecurity2/modsecurity-rules-selected-by-web4host.net.conf
IfModule>

/sbin/service httpd restart
So is this necessarily load in httpd.conf ? and after i if loaded in httpd.conf i must Restart Httpd ?! i hate httpd and apache :((


Note : i want use LiteSpeed Only , not both of apache & LiteSpeed , !and i used CentOS x64 ( x86_64 )
 

-KaaL-

Active Member
#11
You have to load that in /etc/httpd/conf/extra/httpd-includes.conf

LiteSpeed will be with mod_Sec so dont worry.
Yes you restart httpd.
 

Cyber-DL

Active Member
#12
You have to load that in /etc/httpd/conf/extra/httpd-includes.conf

LiteSpeed will be with mod_Sec so dont worry.
Yes you restart httpd.
Open this Page :

Code:
http://heshmati.us/zs.php
i compiled php with that you told me ,

now i've 3 problem in phpinfo page ,


Configuration File (php.ini) Path = /usr/local/lsws/lsphp5/lib | Correct
Loaded Configuration File : (none) | InCorrect
Scan this dir for additional .ini files : (none) | InCorrect

what's happend ? what's wrong with me ?
why Mod_Security2 didn't found in PHPINFO PAGE ?
why Zend Optimizer didn't find in PHPINFO page ,?
why eAccelerator didn't find in PHPINFO page ?


dear admins please follow this Topic !
i want buy License but i got this problems , please help me
Best Regards
 

-KaaL-

Active Member
#13
you need to put the php.ini file in /usr/local/lsws/lsphp5/
then recompile

check if all the path to mod_sec, zend optimizer, etc are proper in php.ini file.
 
Last edited:

grniyce

Well-Known Member
#14
Look for the include /usr/local/apache/mod_sec_user.conf in the httpd.conf file. If that is not in there, then you will need to determine where your user.conf file is, and add that lincludes line.

For example: mine is located in multiple locations because I have multiple mod_security rulesets, however the default rulesets that come with installing mod_security would suggest you enter the following line somewhere in httpd.conf (if it is not already there)

Include usr/local/apache/modsecurity/*.conf
 
Last edited:
#15
i installed Mod_security 2 , but i want know whereIs Mod_Security Logs ? to know which Scripts blocked by Mod_security and why blocked , by which Line of rules ,

note : now i'm using LiteSpeed Enterprise
 
#19
Add this to to the mod security rules file.

SecAuditLog logs/audit_log
i typed SecAuditLog logs/audit_log at the bottom in rules , now whereis logs/audit_log ? it's in /var/logs/audit_log Or in /etc/modsecurity or another path ?

i'm so sorry for my cheap questions,
Best Regards
 

mistwang

LiteSpeed Staff
#20
If you use cPanel, you just enable mod_security for cPanel, if you manage Apache httpd.conf yourself, you can check modsecurity documentation for configuration directives.
 
Top