Install script:
Wget-o/tmp/modsecurity.sh-t 0 http://lnamp.yundaiwei.com/modsecurity/install.sh&&sh/tmp/modsecurity.sh
* Mod_security is a module of the Apache server that can effectively protect against SQL injection, XSS Cross-site, and other attack methods.
* Installation using the Mod_security module will increase CPU footprint, please pay attention to performance issues to make a choice.
* Rule file directory is:/usr/local/httpd/conf/modsecurity
* The configuration file path is:/usr/local/httpd/conf/extra/modsecurity.conf
* Close Mod_security method
Close only to a Web site:
In the site root directory, write the following to the. htaccess file
<ifmodule mod_security2.c>
Secruleremovebyid 0-99999999
</ifmodule>
All sites are closed:
Locate the following in the/usr/local/httpd/conf/httpd.conf file, comment or delete and restart httpd.
# mod_security
LoadModule Security2_module modules/mod_security2.so
LoadModule Unique_id_module modules/mod_unique_id.so
Includeoptional conf/extra/modsecurity.conf
Includeoptional conf/modsecurity/*.conf
* Note that using this module may result in a false seal. Beginners are not recommended for use.