All commands are run as root. |
yum install nano |
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-2.noarch.rpm rpm -Uvh http://rpms.famillecollet.com/el5.x86_64/remi-release-5-4.el5.remi.noarch.rpm |
/etc/yum.repos.d/remi.repo
.
[TECH:remi]
, set enabled=1
.yum install php-pear php-mysql php-mbstring /etc/init.d/httpd restart |
echo "<?php phpinfo();" > /var/www/html/index.php chmod 644 /var/www/html/index.php |
yum install php-pecl-apc /etc/init.d/httpd restart |
yum install zlib-devel memcached php-pecl-memcache /etc/init.d/memcached start Test: telnet localhost 11211 /etc/init.d/httpd restart |
<Directory "/var/www/html">
:
<Directory "/var/www/html"> [...] AllowOverride All [...] </Directory> |
yum install mysql-server |
/etc/my.cnf
under [TECH:mysqld]
:
default_storage_engine = InnoDB default_character_set = utf8 collation_server = utf8_general_ci character_set_server = utf8 |
/etc/init.d/mysqld start /usr/bin/mysqladmin -u root password 'new-password' /usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password' |
yum install ntp chkconfig ntpd on ntpdate pool.ntp.org /etc/init.d/ntpd start |
yum install phpmyadmin |
/etc/httpd/conf.d/phpMyAdmin.conf
to allow access from non-localhost clients./etc/phpMyAdmin/config.inc.php
to add additional servers and use the "mysqli" driver for connections./etc/init.d/httpd restart |
yum install nagios nagios-plugins-disk nagios-plugins-dns nagios-plugins-http nagios-plugins-load \ nagios-plugins-mysql nagios-plugins-ping nagios-plugins-ssh nagios-plugins-users nagios-plugins-procs \ nagios-plugins-nrpe nagios-plugins-swap htpasswd -c /etc/nagios/passwd nagios chgrp apache /etc/nagios/passwd chmod 640 /etc/nagios/passwd |
/etc/httpd/conf.d/nagios.conf
.
allow from 127.0.0.1
to allow from all
./etc/nagios/nagios.cfg
.
cfg_dir=/etc/nagios/servers
.mkdir /etc/nagios/servers && chgrp nagios /etc/nagios/servers && chmod g+s /etc/nagios/servers
./etc/nagios/localhost.cfg
to change nagios-admin
to nagios
./etc/nagios/commands.cfg
to support querying NRPE on remote hosts:
define command{ command_name check_nrpe command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ } |
nagios -v /etc/nagios/nagios.cfg |
/etc/nagios/servers
./etc/init.d/httpd restart /etc/init.d/nagios restart |
yum install nrpe nagios-plugins-disk nagios-plugins-load nagios-plugins-ping \ nagios-plugins-ssh nagios-plugins-users nagios-plugins-procs nagios-plugins-swap |
/etc/nagios/nrpe.cfg
.
allowed_hosts
./etc/init.d/nrpe start |
chkconfig nrpe on |
/usr/lib64/nagios/plugins/check_nrpe -H [nrpe-remote-host] |
/usr/lib64/nagios/plugins/check_nrpe -H [nrpe-remote-host] -c [command] |
yum install nagios-plugins-http |
check_http
command to /etc/nagios/nrpe.cfg
:
command[check_http]=/usr/lib64/nagios/plugins/check_http -w 5 -c 20 -I 127.0.0.1 |
yum install nagios-plugins-mysql |
CREATE USER 'nrpe'@'localhost' IDENTIFIED BY 'nrpe'; GRANT REPLICATION CLIENT ON *.* TO 'nrpe'@'localhost'; |
check_mysql
command to /etc/nagios/nrpe.cfg
for a non-slave server:
command[check_mysql]=/usr/lib64/nagios/plugins/check_mysql -u nrpe -p nrpe |
check_mysql
command to /etc/nagios/nrpe.cfg
for a slave server:
command[check_mysql]=/usr/lib64/nagios/plugins/check_mysql -u nrpe -p nrpe -S -w 2 -c 10 |
yum install php-snmp net-snmp net-snmp-utils cacti |
/etc/cacti/db.php
:
$database_type = 'mysql'; $database_default = 'cacti'; $database_hostname = 'localhost'; $database_username = 'cacti'; $database_password = 'password-here'; $database_port = '3306'; |
mysql -p cacti < /usr/share/doc/cacti-0.8.7b/cacti.sql mysql_convert_table_format --password="mysql-root-password" --type="InnoDB" cacti |
/etc/httpd/conf.d/cacti.conf
to allow access from non-localhost./etc/init.d/httpd restart |
*/5 * * * * /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
to cacti
's crontab:
export EDITOR=nano crontab -u cacti -e |
chgrp -R apache /var/lib/cacti/rra chmode -R g+s /var/lib/cacti/rra |
admin
/admin
.yum install net-snmp net-snmp-libs net-snmp-utils |
/etc/snmp/snmpd.conf
is the default, move it:
mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.original # snmpconf -i -g basic_setup |
/etc/snmp/snmpd.conf
:
rocommunity public cacti-server-ip rocommunity public 127.0.0.1 dontPrintUnits true includeAllDisks |
/etc/init.d/snmpd start chkconfig snmpd on |
/etc/snmp/snmpd.conf
:
proc httpd |
To be written. |
yum install gcc openssl-devel wget http://downloads.sourceforge.net/curl-loader/curl-loader-0.46.tar.gz tar xzf curl-loader-0.46.tar.gz rm curl-loader-0.46.tar.gz cd curl-loader-0.46 make make install |
curl-loader -f configfile |
pear install pecl/xdebug /etc/init.d/httpd restart |
/etc/php.d/xdebug.conf
:
zend_extension=/usr/lib64/php/modules/xdebug.so xdebug.profiler_enable_trigger = 1 |
/etc/init.d/httpd restart |