Tuesday, March 13, 2012

Install mod_security in Kloxo (Lxadmin) on Centos 5.3




First of all make sure you switched the default webserver to Apache2. This can be done in the Kloxo admin console under the Server > Switch server tab.

Retrieve the mod_security binary for your platform. You can find detailed information here, but below are the key steps assuming you're running a Centos 5.3 VPS.

1. Validate the packages by installing the GPG key:

rpm --import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

2. Add the following to your '/etc/sysconfig/rhn/sources' file:

yum utterramblings http://www.jasonlitka.com/media/EL5/$ARCH

3. Type:

vi /etc/yum.repos.d/utterramblings.repo

... and then paste the following into the editor:

[utterramblings]
name=Jason's Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

4. Update your yum repository by typing yum update and accepting the update. This might take a bit of time depending on when you did your last update.

5. Install modsecurity by typing: yum install mod_security

6. Restart the Apache webserver: service httpd restart.

That's it!

Note that a default ruleset is included and activated during the installation. If you want to edit the configuration, the following can be useful:

/etc/httpd/conf.d: all files in this directory are loaded during Apache startup
/etc/httpd/conf.d/mod_security.conf: default configuration loading the mod_security module and the default rule set
/etc/httpd/modsecurity.d: default rule set


Tham khao: http://www.clientcentral.info/knowledgebase.php?action=displaycat&catid=1015

No comments: