2010년 3월 10일 수요일

APM + Library 설치

[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

===============================================
Step 1 : Install Packages
===============================================
1.1 ZLIB 설치 (http://www.gzip.org/zlib/)
http://www.zlib.net/zlib-1.2.3.tar.gz
-----------------------------------------------
#tar xvfz zlib*
#cd zlib*
#./configure
#make
#make install
#cd ..
#rm -rf zlib*
-----------------------------------------------
1.2 LIBPNG 설치 (http://www.libpng.org/pub/png/libpng.html)
http://prdownloads.sourceforge.net/libpng/libpng-1.2.16-no-config.tar.gz?download
-----------------------------------------------
#tar xvfz libpng*
#cd libpng*
#cp scripts/makefile.linux makefile
#make test
#make install
#cd ..
#rm -rf libpng*
-----------------------------------------------
1.3 FREETYPE 설치 (http://freetype.sourceforge.net/)
http://download.savannah.gnu.org/releases/freetype/freetype-2.3.4.tar.gz
http://download.savannah.gnu.org/releases/freetype/freetype-2.2.1.tar.gz
-----------------------------------------------
#tar xvfz freetype*
#cd freetype*
#./configure
#make
#make install
#cd ..
#rm -rf freetype*
-----------------------------------------------
1.4 JPEGSRC 설치 (ftp://ftp.uu.net/graphics/jpeg/)
ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
-----------------------------------------------
#tar xvfz jpegsrc*
#cd jpeg-6b
#./configure --enable-shared --enable-static
#make
#make test
#make install
#make install-lib
#make install-headers
#cd ..
#rm -rf jpegsrc*
-----------------------------------------------
1.5 GD 설치
http://www.boutell.com/gd/http/gd-2.0.9.tar.gz
-----------------------------------------------
#tar xvfz gd*
#cd gd*
#./configure
#make
#make install
#cd ..
#rm -rf gd*
 
(위에서 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" 라는 구문을 넣어준다.)

-----------------------------------------------
1.6 LIBXML2 설치 (http://xmlsoft.org/downloads.html)
ftp://xmlsoft.org/libxml2/libxml2-2.6.28.tar.gz
-----------------------------------------------
#tar xvfz libxml2*
#cd libxml2*
#./configure
#make
#make install
#cd ..
-----------------------------------------------
1.7 LIBICONV 설치 (http://www.gnu.org/software/libiconv/)
ftp://ftp.kaist.ac.kr/gnu/libiconv/libiconv-1.9.2.tar.gz
http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.11.tar.gz
-----------------------------------------------
#tar xvfz libiconv*
#cd libiconv*
#./configure --prefix=/usr/local
#make
#make install
#ln -s /usr/local/lib/libiconv.so.2 /usr/lib/libiconv.so.2
#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 "새비밀번호"
-----------------------------------------------
2.2 APACHE2 설치
http://ftp.kaist.ac.kr/pub/Apache/httpd/httpd-2.2.4.tar.gz
-----------------------------------------------
#tar xvfz httpd*
#cd httpd*
#./configure --prefix=/usr/local/apache2 --enable-modules=so --enable-so --enable-rewrite
#make
#make install
-----------------------------------------------
2.3 PHP5 설치 (5.2.x는 에러난다 5.1.6으로!!)
http://kr2.php.net/get/php-5.2.1.tar.gz/from/this/mirror
http://www.rootman.co.kr/NFS2/APM/php-5.1.4.tar.bz2
-----------------------------------------------
#vi /etc/ld.so.conf (라이브러리 인식시키기..)
* 다음라인을 추가
/lib
/usr/lib
/usr/local/lib
/usr/local/mysql/lib/mysql
#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 패키지가 설치가 되어있는지 확인)

#make
#make install
#cp php.ini-dist /usr/local/php/lib/php.ini
-----------------------------------------------
2.4 ZendOptimizer3 설치  <--이건 안해도됨
http://www.rootman.co.kr/NFS2/Zend/ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz
-----------------------------------------------
#tar xvfz Zend*
#cd Zend*
#./install.sh
-----------------------------------------------
 
===============================================
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

댓글 없음:

댓글 쓰기