Installing mod_security

sudo aptitude install libapache2-modsecurity

sudo mkdir /etc/apache2/modsecurity

sudo vi /etc/apache2/conf.d/modsecurity.conf

## /etc/init.d/apache2/conf.d/modsecurity.conf
Include modsecurity/*.conf

cd /etc/apache2/modsecurity/

sudo cp -R /usr/share/modsecurity-crs/base_rules/* .

sudo vi /etc/apache2/modsecurity/modsecurity_crs_20_protocol_violations.conf

Replace this line:

SecRule REQBODY_ERROR “!@eq 0” \


with this one:

SecRule REQBODY_PROCESSOR_ERROR “!@eq 0” \ 

sudo service apache2 restart

cat /var/log/apache2/error.log | grep modsecurity

Installing packages in Ubuntu from cdrom (no Internet)

In many cases, the dev class vm’s do not have Internet access (annoying) so you cannot install software vi the Internet.

Mount the ISO in the VM.

On the server run the following command:

sudo mount /dev/sr0 /cdrom

ensure that only the following line is uncommented in /etc/ap[t/sources.list

deb cdrom:[Ubuntu-Server 10.04 LTS _Lucid Lynx_ – Release amd64 (20100427)]/ lucid main restricted

Run sudo apt-get update to update the repository. Then install what you need.

nagios-check-webpage

This is a ruby script that can download a web page. Source here:

http://code.google.com/p/nagios-check-webpage/

Installation:

Prerequisites:

apt-get install ruby rubygems

gem update

apt-get install ruby1.8-dev

gem install hpricot

apt-get install libopenssl-ruby

 

Nagios Check Command:

define command{
        command_name    check-webpage
        command_line    $USER1$/check_webpage.rb -u $HOSTADDRESS$$ARG1$
        }