본문 바로가기

리눅스

[APM] APM 및 cacti 설치 [최종]_2010/07/28

반응형

1. APM 설치

 

패키지 버전 정보

mysql-5.0.45.tar.gz

httpd-2.2.11.tar.bz2

php-5.2.5.tar.gz

ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz

 

1-1 필요 라이브러리 설치

[root@byungun ~]# yum -y install gd gd-devel libpng libpng-devel libjpeg libjpeg-devel freetype freetype-devel fontconfig  fontconfig-devel libxml2 libxml2-devel openssl openssl-devel gmp gmp-devel mhash mhash-devel libmcrypt libmcrypt-devel

 

1-2 MySQL 설치

[root@byungun mysql-5.0.45]# useradd -m -c "MySQL Server" -d /usr/local/mysql -s /bin/false -u 27 mysql

[root@byungun mysql-5.0.45]# ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --with-charset=euckr --with-extra-charsets=all

[root@byungun mysql-5.0.45]# make

[root@byungun mysql-5.0.45]# make install

[root@byungun mysql-5.0.45]# cp /usr/local/mysql/share/mysql/my-huge.cnf /etc/my.cnf

 

-- 용도별 카피

my-small.cnf : 64M

my-medium.cnf 128-256M

my-large.cnf 512M

my-huge.cnf 1~2G

 

[root@byungun mysql-5.0.45]# /usr/local/mysql/bin/mysql_install_db

[root@byungun mysql-5.0.45]# cd /usr/local/mysql

[root@byungun mysql]# chown mysql.mysql data -R

[root@byungun mysql]# /usr/local/mysql/bin/mysqld_safe &

[root@byungun mysql]# ps ax | grep mysqld

[root@byungun mysql]# cp -p /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld

[root@byungun mysql]# ln -s /usr/local/mysql/bin/mysql /usr/bin/

[root@byungun mysql]# ln -s /usr/local/mysql/bin/mysqldump /usr/bin/

[root@byungun mysql]# /usr/local/mysql/bin/mysqladmin -u root password "비밀번호"

 

1-3 Apache 설치

[root@byungun httpd-2.2.11]# useradd -c "Apache" -u 48 -s /sbin/nologin apache

[root@byungun httpd-2.2.11]# ./configure --prefix=/usr/local/apache2 --enable-so --enable-shared=max --enable-rewrite --enable-ssl --enable-proxy

[root@byungun httpd-2.2.11]# make

[root@byungun httpd-2.2.11]# make install

[root@byungun httpd-2.2.11]# cp -p /usr/local/apache2/bin/apachectl /etc/init.d/httpd

 

아래 두 라인 추가

[root@byungun httpd-2.2.11]# vi /etc/init.d/httpd

chkconfig: 2345 80 30

description: HTTPD

 

[root@byungun httpd-2.2.11]# chkconfig --add httpd

[root@byungun httpd-2.2.11]# chkconfig --level 345 httpd on

[root@byungun httpd-2.2.11]# chkconfig --list | grep httpd

 

[root@byungun httpd-2.2.11]# /usr/local/apache2/bin/apachectl start

[root@byungun httpd-2.2.11]# ps -ef | grep httpd

 

1-4 PHP 설치

[root@byungun php-5.2.5]# ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache2/bin/apxs --enable-sysvshm=yes --enable-sysvsem=yes --enable-debug=no --with-ttf --with-png-dir=/usr --with-zlib-dir --with-jpeg-dir=/usr --with-gdbm=/usr --enable-ftp --enable-mbstring --enable-sockets --enable-wddx --with-freetype-dir=/usr --enable-bcmath --with-curl --with-mcrypt --enable-mbregex --enable-exif --with-gd --enable-gd-native-ttf --enable-calendar --with-openssl --with-libxml-dir

[root@byungun php-5.2.5]# make

[root@byungun php-5.2.5]# make install

 

[root@byungun  php-5.2.5]# cp -p /usr/local/src/php-5.2.5/php.ini-dist /usr/local/php/lib/php.ini

 

httpd.conf 파일 변경

 

# LoadModule foo_module modules/mod_foo.so

LoadModule php5_module modules/libphp5.so

 

AddType application/x-httpd-php .ph .php .php3 .inc .asp .html

AddType application/x-httpd-php-source .phps

 

DirectoryIndex index.html index.htm index.php

 

1-5 Zend 설치

[root@byungun ZendOptimizer-3.3.3-linux-glibc23-i386]# sh install.sh

 

2. CACTI 설치

 

2-1 필요한 라이브러리 설치

[root@byungun ~]# yum -y install libart_lgpl libart_lgpl-devel.i386

 

2-2 SNMP 설치

[root@byungun net-snmp-5.4]# ./configure --prefix=/usr/local/snmp

[root@byungun net-snmp-5.4]# make

[root@byungun net-snmp-5.4]# make install

 

2-3 RRDTOOL 설치

[root@byungun src]# wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.2.tar.gz

[root@byungun rrdtool-1.4.2]# ./configure --prefix=/usr/local/rrdtoll --disable-tcl --disable-python --disable-ruby

[root@byungun rrdtool-1.4.2]# make

[root@byungun rrdtool-1.4.2]# make install

 

2-4 CACTI 설치

[root@byungun src]# wget http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz

[root@byungun src]# cd /var/www/cacti-0.8.7g

[root@byungun cacti-0.8.7g]# mysqladmin create cacti -u root -p

[root@byungun cacti-0.8.7g]# mysql cacti < cacti.sql -u root -p

[root@byungun cacti-0.8.7g]# mysql mysql -u root -p

mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'cacti1234';

mysql> FLUSH PRIVILEGES;

mysql> show databases;

mysql> use cacti

mysql> show tables;

mysql> quit

[root@byungun cacti-0.8.7g]# vi include/config.php

...

$database_type = "mysql";

$database_default = "cacti";

$database_hostname = "localhost";

$database_username = "cacti";

$database_password = "cacti1234";

...

[root@byungun cacti-0.8.7g]# chmod 777 rra log

 

 

 

728x90
반응형