VirtualBox 설치
OS 다운로드
http://ftp.kaist.ac.kr/CentOS/6.6/isos/x86_64/CentOS-6.6-x86_64-minimal.iso
CentOS 6.6(6.5도 같음) 설치
yum update
yum install wget
APM 다운로드
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.73.tar.gz -O /usr/local/src/mysql-5.1.73.tar.gz
wget http://kr1.php.net/get/php-5.3.29.tar.gz/from/this/mirror -O /usr/local/src/php-5.3.29.tar.gz
wget http://apache.tt.co.kr//httpd/httpd-2.2.29.tar.gz -O /usr/local/src/httpd-2.2.29.tar.gz
wget -O libmcrypt-2.5.8.tar.gz http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download
필수 프로그램 설치
yum install -y gcc ncurses-devel gcc-c++
MySQL설치
cd /usr/local/src/mysql-5.1.73
./configure --prefix=/usr/local/mysql/mysql-5.1.73 --sysconfigdir=/etc --with-plugins=innodb_plugin --with-plugins=myisam --with-plugins=federated --with-plugins=heap --with-charset=utf8 --with-extra-charsets=all
make
make install
groupadd mysql
adduser -M -c "MySQL Server" -d /usr/local/mysql -g mysql -s /bin/nologin mysql
mkdir /usr/local/service
cp -f /usr/local/src/mysql-5.1.73/support-files/my-medium.cnf /etc/my.cnf
ln -s /usr/local/mysql/mysql-5.1.73/ /usr/local/service/mysql
/usr/local/service/mysql/bin/mysql_install_db
mv /usr/local/service/mysql/var /var/mysql
ln -s /var/mysql /usr/local/service/mysql/var
chown -R mysql:root /usr/local/mysql
chown -R mysql:mysql /var/mysql
/usr/local/service/mysql/bin/mysqld_safe &
/usr/local/service/mysql/bin/mysqladmin -u root password 'ekskdhk'
참고 : http://seban21.blog.me/70076490807
Apache 2.2 설치
cd /usr/local/src/http-2.2.29
./configure --prefix=/usr/local/apache2/http-2.2.29 --sysconfdir=/etc/apache2 --enable-so --enable-rewrite
make
make install
ln -s /usr/local/service/apache2/http-2.2.29 /usr/local/service/apache2
ln -s /usr/local/service/apache2/bin/apachectl /sbin/apachectl
참고 : http://diveis.tistory.com/111
libmcrypt설치
cd /usr/local/src/libmcrypt-2.5.8
./configure
make
make install
PHP 5.3설치
yum install libxml2-devel openssl-devel bzip2-devel libcurl-devel gdbm-devel libjpeg-devel libpng-devel libtool-ltdl-devel libtool
apxs를 사용하기 위해 /usr/local/service/apache2/bin/apxs 파일의 맨 위의 인터프리터를 /usr/bin/perl -w 로 변경해주었음.
./configure --prefix=/usr/local/php5/php-5.3.29 --with-apxs2=/usr/local/service/apache2/bin/apxs --with-config-file-path=/etc/php5 --with-zlib --with-openssl --with-mysqli=mysqlnd --with-mcrypt=/usr/local/lib --with-iconv --with-gettext --with-gdbm --with-gd --with-curl --with-bz2 --enable-zip --enable-xml --enable-sockets --enable-soap --enable-posix --enable-mbstring=all --enable-maintainer-zts --enable-libxml --enable-gd-native-ttf --enable-ftp --enable-exif --enable-dom --enable-debug --enable-cli --enable-calendar --enable-bcmath
make
make test
make install
libtool --finish /usr/local/src/php-5.3.29/libs
ln -s /usr/local/php5/php-5.3.29/ /usr/local/service/php5
vi /etc/apache2/httpd.conf
AddType application/x-httpd-php .php # 추가
# 방화벽 해제(80)
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
# iptables 재시작
service iptables save
service iptables restart
아파치 데몬 등록
cp /usr/local/service/apache2/bin/apachectl /etc/init.d/httpd
# 권한 부여
chmod 755 /etc/init.d/httpd
vi /etc/init.d/httpd
#!/bin/sh
# chkconfig: 2345 90 90
# description: init file for Apache server daemon
# processname: /usr/local/apache2/bin/apachectl
# config: /usr/local/apache2/conf/httpd.conf
# pidfile: /usr/local/apache2/logs/httpd.pid
ntsysv에 등록
chkconfig --add httpd
MySQL 데몬 등록
cp /usr/local/service/mysql/share/mysql/mysql.server /etc/init.d
chkconfig --add mysql.server
chkconfig --level 2345 mysql.server on
참고 : http://blog.daum.net/ma1101/130