[APM + Library 설치]
===============================================
Step 0 : 설치할 APM 및 라이브러리 파일들 준비
===============================================
zlib-1.2.3.tar.tar
libpng-1.2.12-no-config.tar.gz
freetype-2.2.1.tar.gz
jpegsrc.v6b.tar.gz
gd-2.0.33.tar.tar
libxml2-2.6.26.tar.gz
libiconv-1.9.2.tar.tar
mysql-5.0.22.tar.tar
httpd-2.2.2.tar.tar
php-5.1.4.tar.gz
ZendOptimizer-3.0.0-linux-glibc21-i386.tar.gz
(위에서 zlib 를 설치 했음 에도 불구하고 make 실행시 gdtf.c 파일에서 freetype.h 에서 ft2build.h 가 include 되지 못한 에러가 뜨면 /usr/local/include/freetype2/freetype/ 에 ft2build.h 파일을 복사한 후 gdft.c 파일 55라인 include "freetype/freetype.h" 위에 include "freetype/ft2build.h" 라는 구문을 넣어준다.)
#cd ..
-----------------------------------------------
===============================================
Step 2 : Install APM
===============================================
2.1 MYSQL5 설치
http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.37.tar.gz/from/http://mysql.new21.com/-----------------------------------------------
#tar xvfz mysql*
#cd mysql*
#
./configure \
--prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data \
--disable-shared --enable-assembler \
--with-thread-safe-client --with-mysqld-user="mysql" \
--with-client-ldflags=-all-static \
--with-mysqld-ldflags=-all-static \
--with-readline --without-debug \
--without-docs --without-bench \
--with-charset=euckr
./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --disable-shared --enable-assembler --with-thread-safe-client --with-mysqld-user="mysql" --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --with-readline --without-debug --without-docs --without-bench --with-charset=euckr
#make
#make install
#/usr/local/mysql/bin/mysql_install_db
#groupadd mysql
#adduser -g mysql mysql
#vi /etc/passwd
mysql:x:522:523::/home/mysql:/sbin/nologin // nologin 으로 수정
#rm -rf /home/mysql
#chown -R mysql.mysql /usr/local/mysql/data
#cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
#vi /etc/ld.so.conf
/usr/local/mysql/lib/mysql // 라이브러리 인식시키기 위해서 추가
#ldconfig
#/usr/local/mysql/bin/mysqld_safe &
#/usr/local/mysql/bin/mysqladmin -u root password "새비밀번호"
#ldconfig
#tar xvfz php*
#mv php* /usr/local/php (폴더명을 변경... tar.gz 를 조심...)
#cd /usr/local/php
#
./configure \
--prefix=/usr/local/php \
--with-mysql=/usr/local/mysql \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-expat-dir=/usr \
--with-zlib-dir \
--with-png-dir=/usr \
--with-jpeg-dir=/usr \
--with-gdbm=/usr \
--with-tiff-dir=/usr \
--with-ttf \
--with-freetype-dir=/usr \
--with-gd \
--with-xml --with-xmlrpc \
--with-iconv=/usr/local \
--with-imap \
--with-imap-ssl \
--with-kerberos \
--with-openssl=/usr \
--with-charset=euc_kr \
--enable-ftp \
--enable-sockets \
--enable-sysvshm=yes \
--enable-sysvsem=yes \
--enable-debug=no \
--enable-track-vars=yes \
--enable-url-fopen-wrapper=yes \
--enable-memory-limit \
--enable-mbstring \
--enable-wddx \
--enable-bcmath \
--enable-mbstr-enc-trans \
--enable-mbregex \
--enable-exif \
--enable-gd-native-ttf \
--enable-gd-imgstrttf \
--enable-calendar \
--enable-magic-quotes \
--enable-sigchild \
--enable-pcntl \
./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache2/bin/apxs --with-expat-dir=/usr --with-zlib-dir --with-png-dir=/usr --with-jpeg-dir=/usr --with-gdbm=/usr --with-tiff-dir=/usr --with-ttf --with-freetype-dir=/usr --with-gd --with-xml --with-xmlrpc --with-iconv=/usr/local --with-imap --with-imap-ssl --with-kerberos --with-openssl=/usr --with-charset=euc_kr --enable-ftp --enable-sockets --enable-sysvshm=yes --enable-sysvsem=yes --enable-debug=no --enable-track-vars=yes --enable-url-fopen-wrapper=yes --enable-memory-limit --enable-mbstring --enable-wddx --enable-bcmath --enable-mbstr-enc-trans --enable-mbregex --enable-exif --enable-gd-native-ttf --enable-gd-imgstrttf --enable-calendar --enable-magic-quotes --enable-sigchild --enable-pcntl
DBA 오류 발생시 아래와 같이
./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache2/bin/apxs --with-expat-dir=/usr --with-zlib-dir --with-png-dir=/usr --with-jpeg-dir=/usr --without-gdbm --with-tiff-dir=/usr --with-ttf --with-freetype-dir=/usr --with-gd --with-xml --with-xmlrpc --with-iconv=/usr/local --with-imap --with-imap-ssl --with-kerberos --with-openssl=/usr --with-charset=euc_kr --enable-ftp --enable-sockets --enable-sysvshm=yes --enable-sysvsem=yes --enable-debug=no --enable-track-vars=yes --enable-url-fopen-wrapper=yes --enable-memory-limit --enable-mbstring --enable-wddx --enable-bcmath --enable-mbstr-enc-trans --enable-mbregex --enable-exif --enable-gd-native-ttf --enable-gd-imgstrttf --enable-calendar --enable-magic-quotes --enable-sigchild --enable-pcntl
(위와같이 환경 설정시 rfc822.h 를 못 찾고 c-client 패키지의 설치 여부도 물어보는 문제가 발생하면 php 컴파일시 --with-imap 때문에 rfc822.h 를 참조하게 된다. rfc822.h는 일반적으로 imap-devel 패키지에 포함되어 있다.
첫번째는 imap 이 dovecot 로 제공되고 있으므로 dovecot가 설치되어 있는지 확인.
두번째로 rfc822.h 는 libc-client-devel 에도 포함되어 있으므로 libc-client-devel 패키지가 설치가 되어있는지 확인)
===============================================
Step 3 : Setting APM
===============================================
3.1 Apache2
-----------------------------------------------
#vi /usr/local/apache2/conf/httpd.conf
CustomLog logs/access_log common << 이 부분을 수정
SetEnvIfNoCase Request_URI (gif|png|jpg|css|js|bmp|jpeg|swf)$ IMAGE=1
CustomLog /usr/local/apache2/logs/access_log common env=!IMAGE
//있는지 확인후 없으면 추가
LoadModule php5_module modules/libphp5.so
// php파일을 웹서버에서 인식하기 위해 아래두줄 추가
AddType application/x-httpd-php .php .html .htm .inc
AddType application/x-httpd-php-source .phps
// 처음페이지로 인식할 파일명설정
DirectoryIndex index.html index.htm index.php
-----------------------------------------------
===============================================
Step 4 : 부팅시 자동 실행
===============================================
4.1 MySQL
-----------------------------------------------
#cp -p /usr/local/mysql/share/mysql/mysql.server /etc/rc.d/init.d/mysqld
#ln -s /etc/rc.d/init.d/mysqld /etc/rc.d/rc3.d/S90mysqld
#/etc/rc.d/init.d/mysqld start
#/etc/rc.d/init.d/mysqld stop
-----------------------------------------------
4.2 Apache
-----------------------------------------------
#ln -s /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd
// run level 3인 경우
#ln -s /etc/rc.d/init.d/httpd /etc/rc.d/rc3.d/S75httpd