How To Install mod_security/mod_security2 On SuSE Linux Enterprise Server 10 (SLES10)
|
Submitted by Elconas (Contact Author) (Forums) on Fri, 2008-04-18 08:38. :: SuSE | Apache | Security
How To Install mod_security/mod_security2 On SuSE Linux Enterprise Server 10 (SLES10)IntroductionThe Apache module mod_security is a very powerful security module. Combined with predefined rules, you can close many security wholes on your server, opened by bad written php or perl apps. Unfortunately mod_security is not part of the SLES10 distribution. To install mod_security to have to install some 3rd party modules. This guide helps you to install mod_security on SLES10. It also helps you to remove the module, by building RPM packages you can easily uninstall. Install Apache2First of all you have to install apache2. This is very simple with the following command. yast2 -i apache2 Install requried build packagesSome modules are required to build the mod_security module. Install the following packages: yast2 -i libxml2-devel pcre-devel apache2-devel curl-devel gcc gcc-c++ Apache2-devel is required for apxs2. curl-devel is optional. Get and Install checkinstall (for packaging)To keep track of installed software and enable the user to uninstall and update software, checkinstall can build RPM, DEBIAN (DEB) and Slackware packages. Instead of executing "make install" just run "checkinstall" and checkinstall catches all files, that would be installed by "make install". Get checkinstall from http://www.asic-linux.com.mx/~izto/checkinstall/download.php. wget http://www.asic-linux.com.mx/~izto/checkinstall/files/source/checkinstall-1.6.1.tgz Get and Install libluaThe LUA programming language is used by mod_security for configuration. You must compile LUA as shared module. Get LUA from http://www.lua.org/ftp/lua-5.1.3.tar.gz. wget http://www.lua.org/ftp/lua-5.1.3.tar.gz [...] cp /usr/src/packages/RPMS/i386/lua-5.1.3-1.i386.rpm .. Now you have to build a shared library from the liblua archive. cd /usr/local/lib Get and Install mod_securityGet mod_security from http://www.modsecurity.org/download/direct.html. Documentation about the installation can be found here: http://www.modsecurity.org/documentation/index.html. cd modsecurity-apache_2.5.2 ... cp /usr/src/packages/RPMS/i386/apache2-mod_security-2.5.2-1.i386.rpm ../../ Configure Apache2 for mod_security# /etc/apache2/conf.d/mod_security.conf
Extract and Configure Core RulesGet the core rules from http://www.modsecurity.org/download/modsecurity-core-rules_2.5-1.6.0.tar.gz. cd /etc/apache2 Modify modsecurity_crs_10_config.conf to meet the location of your config files: vi modsecurity_crs_10_config.conf Restart Apache and Test your WebpageFirst restart apache to get the current configuration: rcapache restart To test the installation, write a simple (insecure) PHP script like this: <?
# /srv/www/htdoc/index.php Then access it to try opening insecure files: http://ip.of.your.server.de/index.php?file=/etc/passwd You should get ERROR 501 in your browser and the SecAuditLog file should show: [...] Caveats
Links and References
|






Recent comments
11 hours 12 min ago
12 hours 10 min ago
12 hours 22 min ago
18 hours 27 min ago
20 hours 56 min ago
22 hours 7 min ago
1 day 1 hour ago
1 day 2 hours ago
1 day 3 hours ago
1 day 6 hours ago