Sunday, April 11, 2010

Basic Centos Setup #1

1. Change the default email to whatever external mail might be
echo ${EMAIL} >> /root/.forward

2. Logwatch
yum install logwatch

2.1. Edit the conf file /usr/share/logwatch/default.conf/logfiles/cron.conf
Replace line 20
Archive=cron.*
with
Archive=/var/log/cron.*

3. Aide
yum install aide

3.1. Initialize the database
aide --init

3.2. Copy the database to the regular spot
cp /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz

3.3. Add a cron script to run aide daily
/etc/cron.daily/aide.cron
#!/bin/bash
/usr/sbin/aide --check | /bin/mail -s "Daily AIDE check" ${EMAIL}

Using Dag Wiers RPMForge with centos5

Original Source: Centos RPMForge Setup

1. Install priorities plugin for yum
yum install yum-priorities

2. Enable plugins (usually turned on by default)
/etc/yum/pluginconf.d/priorities.conf
[main]
enabled=1

3. Edit all the repos.conf

3.1. /etc/yum.repos.d/CentOS-Base.repo
[base], [updates], [addons] [extras] ... priority=1
[centosplus] [contrib] ... priority=2


3.2. /etc/yum.repos.d/vz.repo
[vz-base] ... priority=3
[vz-updates] ... priority=4

4. Get Dag RPM
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm

5. Import the GPG key for Dag's repo
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

6. Verify the RPM package
rpm -K rpmforge-release-0.5.1-1.el5.rf.*.rpm

7. Install RPM
rpm -i rpmforge-release-0.5.1-1.el5.rf.*.rpm

8. Reset the RPMForge priority. Edit /etc/yum.repos.d/rpmforge.repo
[rpmforge]
priority=10

9. Test the setup
yum check-update