参考了Joecen大虾的大作,看到还有那么多弟兄在迷糊,索性把自己的过程写出来,希望能对大家有所帮助,呵呵,我是在centos4.2上做的,4.0一样。
1.
Mysql source code installation
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql &
cp ./support-files/mysql.server /etc/init.d/mysql (In mysql scurce code directory)
chmod +x /etc/init.d/mysql
cd /etc/rc3.d and rc5.d
ln -s ../init.d/mysql S86mysql
ln -s ../init.d/mysql K86mysql (Note: the number in filename doesn't conflict with other scripts)
2.
Apache installation
./configure --prefix=/www --enable-so
make && make install
cp /www/bin/apachectl /etc/init.d/httpd
cd /etc/rc3.d and rc5.d
ln -s ../init.d/httpd S87httpd
ln -s ../init.d/httpd K87httpd
or
chkconfig --add httpd
chkconfig --level 35 httpd on
3.
PHP Installation
./configure --prefix=/www/php --with-apxs2=/www/bin/apxs
--with-config-file-path=/www/php --enable-sockets
--with-mysql=/usr/local/mysql --with-zlib-dir=/usr/include --with-gd
make && make install
cp php.ini-dist /www/php/php.ini
vi /www/conf/httpd.conf
加入:
###############for php and cacti###################
AddType application/x-tar .tgz
AddType application/x-httpd-php .php
AddType image/x-icon .ico
DirectoryIndex index.php index.html index.html.var
#######################over########################
/etc/init.d/httpd restart
4.
Mysql setting
/usr/local/mysql/bin/mysql -u root -p
mysql> set password for root@localhost=password('cactipw');
mysql> Query OK, 0 rows affected (0.00 sec)
mysql> create database cacti;
mysql> grant all on cacti.* to root;
mysql> grant all on cacti.* to root@localhost;
mysql> grant all on cacti.* to cactiuser;
mysql> grant all on cacti.* to cactiuser@localhost;
mysql> set password for cactiuser@localhost=password('cactipw');
mysql> flush privileges; (See cacti docs/INSTALL)
mysql> exit
5、rrdtool installation
download:
then
./configure
make && make install
6、net-snmp installation
Download the latest version and install it.
7、cacti installation
cp cacti-0.8.6g.tar.gz /www/htdocs
tar xzvf cacti-0.8.6g.tar.gz
mv cacti-0.8.6g cacti
cd cacti
/usr/local/mysql/bin/mysql –u root –psccmrtg cacti < cacti.sql
chown –R cactiuser rra/ log/
or
chown -R cactiuser /www/htdocs/cacti
vi /www/htdocs/cacti/include/config.php
$database_type = “mysql”;
$database_default = “cacti”;
$database_hostname = “localhost”;
$database_username = “cactiuser”;
$database_password = “cactipw”;
useradd cactiuser
passwd cactiuser
su - cactiuser
Crontab –u cactiuser –e
*/5 * * * * /www/php/bin/php /www/htdocs/cacti/poller.php > /dev/null 2>&1
/etc/init.d/crond restart
Logon to internet and perform below command in shell window:
wget
wget
wget
wget
patch -p1 -N < short_open_tag_parse_error.patch
patch -p1 -N < graph_properties_zoom.patch
patch -p1 -N < script_server_snmp_auth.patch
patch -p1 -N < mib_file_loading.patch
cactid installation
./configure --with-mysql=/usr/local/mysql/include
make && make install
modify cactid.conf and copy it to /usr/local/cactid/
ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock
or
cd /var/lib
ln -s /tmp mysql
8. threshold installation.(Add email or syslog alert function)
thold-0.2.5.zip
cd thold-0.2.5
./install.sh /www/htdocs/cacti/ cactiuser cactipw
You'd better add /usr/local/mysql/bin to $PATH.
9. Cacti settings
10. other plugins installation
Monitor, Report,...
If you want to migrate cacti to another host, just use mysqldump to
export cacti configuration, use source command in mysql to inport
config, then copy /log and /rra to new host.
阅读(908) | 评论(0) | 转发(0) |