Posts Tagged ‘centos’

CentOS 5 – install rpmforge yum repo

May 13th, 2010

Install DAG GPG key

wget http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt     # download DAG GPG key
rpm --import RPM-GPG-KEY.dag.txt                                # import the key
rm RPM-GPG-KEY.dag.txt                                          # clean up after ourselves

Install yum-priorities

yum install yum-priorities

Download and install package (i386 – 32bit)

wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm -Uhv rpmforge-release-0.3.6-1.el5.rf.i386.rpm           # install the rpmforge yum repo
rm rpmforge-release-0.3.6-1.el5.rf.i386.rpm                 # clean up after ourselves

Download and install package (x86_64 – 64bit)

wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
rpm -Uhv rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm         # install the rpmforge yum repo
rm rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm               # clean up after ourselves

Set priorities

vim /etc/yum.repos.d/CentOS-Base.repo
[base] or [updates] or [addons] or [extras]
priority=1
[centosplus]
priority=2
vim /etc/yum.repos.d/rpmforge.repo
[rpmforge]
priority=10

install nagios in centos5.4

April 22nd, 2010

Add RPMForge Yum Repository
Add RPMForge Yum RepositoryFor x86 (32-bit) systems
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
From Dag Wieers
For x64 (64-bit) systems
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
Install & Configure Prerequisites
Install Apache
yum install httpd php gcc glibc glibc-common gd gd-devel
Configure Apache to start on boot
/sbin/chkconfig –levels 345 httpd on
Configure iptables to allow Apache traffic
/sbin/iptables -I INPUT -p tcp –dport 80 -j ACCEPT
/etc/init.d/iptables save
/etc/init.d/iptables restart
Install & Configure Nagios
Install Nagios & Plugins
yum install nagios nagios-plugins nagios-plugins-setuid
Create the default Nagios web access user & set a password
htpasswd -c /etc/nagios/htpasswd.users nagiosadmin
Verify default config files
nagios -v /etc/nagios/nagios.cfg
Start Nagios
/etc/init.d/nagios start
Start Apache
/etc/init.d/httpd start
Verify Install

Try logging into your new Nagios installation by going to http://servername/nagios/ and logging in with nagiosadmin and the password you set.
Notes
Resources on configuring Nagios can be found in the official documentation. In addition, the CentOS wiki has a nice page here.
Not all plugins will run without additional packages being installed (Ex. check_mysql won’t run without installing mysql).

http://docs.cslabs.clarkson.edu/wiki/Install_Nagios_on_CentOS_5

install mysql server on CentOS

April 7th, 2010

yum install mysql-server mysql php-mysql

chkconfig –levels 235 mysqld on

/usr/bin/mysql_secure_installation

/usr/bin/mysqladmin -u root password ‘new-password’
/usr/bin/mysqladmin -u root -h localhost password ‘new-password’