Friday 7 June 2013

랙자원 관리툴 RackTables 설치


RackTables

1. System Set Up

  • Installing Dependency Packages
다음 명령으로 의존성 패키지를 설치한다:
 $ yum install mysql-server mysql
 $ yum install php php-mysql php-pdo php-gd php-snmp php-mbstring php-pecl-json php-bcmath
php-bcmath는 0.20.1 부터 필수
  • Configuring MySQL
/etc/my.cnf를 편집하여 MySQL이 기본적으로 UTF-8(디폴트)을 명시적으로 사용하도록 한다:
chracter-set-server=utf8
MySQL의 root 계정 설정이 되어있지 않거나 처음 사용한다면, 다음 명령으로 root 계정의 암호를 설정한다.
# service mysqld start
# mysqladmin -u root password '설정할 암호'
MySQL을 부팅 시 동작 시키려 한다면 다음 명령을 수행한다:
# chkconfig mysqld
  • Configuring Apache & PHP
Apache Web Server가 동작 중인지 확인한다:
 $ service httpd status
만일 실행 상태가 아니라면 다음 명령으로 동작 시킨다:
 $ service httpd start
Apache Web Server에서 PHP가 동작되는지 확인을 위해서 /var/www/html/test.php을 다음과 같이 생성한다:
<?php phpinfo() ?>
Apache Web Server에서 PHP가 동작되는지 확인:
PHP 동작을 확인하기 위해 브라우저에서 다음 URL을 테스트 한다.
 http://<hostname or IP>/test.php
시스템 부팅 시 동작 시키려 한다면 다음 명령을 수행한다:
  $ chkconfig httpd

2. Rebuild PCRE Package

yum으로 설치된 pcre 패키지는 아쉽게도 unicode properties 기능이 지원되지 않아 RackTables 설치를 할 수 없다. 이를 수정하기 위해 PCRE를 다시 빌드하여 설치 해야만 하는데 이 과정은 RPM에 관련된 지식을 요구하므로 단순히 참고용으로만 기록하겠다.
  • unicode properties 기능 지원 여부 확인:
     $ pcretest -C
     PCRE version 6.6 06-Feb-2006
     Compiled with
       UTF-8 support
       No Unicode properties support
       Newline character is LF
       Internal link size = 2
       POSIX malloc threshold = 10
       Default match limit = 10000000
       Default recursion depth limit = 10000000
       Match recursion uses stack
  • RPM 빌드용 관련 패키지 설치:
     # yum install rpm-build
  • 패치 및 다시 빌드:
     # echo "# Path to top of build area" > ~/.rpmmacros
     # echo "%_topdir    /home/you/src/rpm" > ~/.rpmmacros
    
     # mkdir -p ~/src/rpm
     # mkdir ~/src/rpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
     # mkdir ~/src/rpm/RPMS/{i386,i486,i586,i686,noarch,athlon}
    
     # wget http://centos.mirror.cdnetworks.com/5/os/SRPMS/pcre-6.6-2.el5_1.7.src.rpm
     # rpm -ihv pcre-6.6-2.el5_1.7.src.rpm 
    
     #다음과 관련된 메시지는 모두 무시
     warning: group mockbuild does not exist - using root
     warning: user mockbuild does not exist - using root
    
     # vi ~/src/rpm/SPECS/pcre.spec 
       %configure --enable-utf8을 다음과 같이 변경
       %configure --enable-utf8 --enable-unicode-properties
     
     # rpmbuild -ba ~/src/rpm/SPECS/pcre.spec
    
  • 빌드된 패키지 업데이트:
     # rpm -Uvh /usr/src/redhat/RPMS/i386/pcre-6.6-2.7.i386.rpm
  • unicode properties 기능 지원 여부 재확인:
     $ pcretest -C
     PCRE version 6.6 06-Feb-2006
     Compiled with
       UTF-8 support
       Unicode properties support
       Newline character is LF
       Internal link size = 2
       POSIX malloc threshold = 10
       Default match limit = 10000000
       Default recursion depth limit = 10000000
       Match recursion uses stack

3. Copying RackTables files

  • 웹 파일이 저장될 디렉토리 생성:
     $ mkdir /var/www/html/racktables
  • 웹 파일들 복사:
     $ cp -r Racktables-0.19.0/wwwroot/* /var/www/html/racktables

4. Creating a database for RackTables

 # mysql -u root -p
 mysql> CREATE DATABASE racktables_db CHARACTER SET utf8 COLLATE utf8_general_ci;
 mysql> grant all privileges on racktables_db.* to racktablesuser@'localhost' identified by '설정할 암호';

5. Installing RackTables

  • RackTables Apache 환경 설정 파일(/etc/httpd/conf.d/httpd-racktables.conf 생성 및 편집:
     $ vi /etc/httpd/conf.d/httpd-racktables.conf
     <Location /racktables>
        Options ExecCGI FollowSymLinks Includes
    
            DirectoryIndex index.php
    
            # Change the following line to load configuration file from another location
     </Location>
  • RackTables 웹 설치 마법사 화면 접근:
     http://<호스트이름 or IP>/racktables/install.php
    이제 안내에 따라 순차적으로 진행하면 된다.

No comments:

Post a Comment