현재 환경 윈도2003 / 리눅스 CentOS 5.0
[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
tiff-3.7.2
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/)
-----------------------------------------------
#tar xvfz zlib*
#cd zlib*
#./configure
#make
#make install
#cd ..
#rm -rf zlib*
-----------------------------------------------
1.2 LIBPNG 설치 (http://www.libpng.org/pub/png/libpng.html)
-----------------------------------------------
#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/)
-----------------------------------------------
#tar xvfz freetype*
#cd freetype*
#./configure
#make
#make install
#cd ..
#rm -rf freetype*
-----------------------------------------------
1.4 JPEGSRC 설치 (ftp://ftp.uu.net/graphics/jpeg/)
-----------------------------------------------
#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 설치
-----------------------------------------------
#tar xvfz gd*
#cd gd*
#./configure
#make
#make install
#cd ..
#rm -rf gd*
-----------------------------------------------
1.6 LIBXML2 설치 (http://xmlsoft.org/downloads.html)
-----------------------------------------------
#tar xvfz libxml2*
#cd libxml2*
#./configure
#make
#make install
#cd ..
이게 안될때
libxml2 설치
]# wget ftp://xmlsoft.org/libxml2/libxml2-2.6.31.tar.gz
]# tar xvfpz libxml2-2.6.31.tar.gz
]# cd libxml2-2.6.31
libxml2-2.6.31]# ./configure
libxml2-2.6.31]# make
libxml2-2.6.31]# make install
[출처] libxml2 설치|작성자 아수
-----------------------------------------------
1.7 LIBICONV 설치 (http://www.gnu.org/software/libiconv/)
-----------------------------------------------
#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 설치
-----------------------------------------------
#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
OS 를 fedora Core 6 에서 CentOS 5 로 바꿨더니 필요한 패키지가 없었다.
configure 시 오류 메세지
checking for termcap functions library... configure: error: No curses/termcap library found
기본 ncurses가 깔려있어도 오류가 나서 devel버젼을 설치했다.
[root@willow mysql-5.0.45]# yum -y install ncurses-devel
~ 생략~
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
ncurses-devel i386 5.5-24.20060715 base 1.6 M
~ 생략 ~
다시 configure 시도~ 성공~
[출처] configure: error: No curses/termcap library found|작성자 기다림
#make
depcomp: line 512: exec: g++: not found에러시
g++ 설치해준다(gcc도 없으면 설치!!)
--> #yum install gcc-c++
#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 설치
-----------------------------------------------
#tar xvfz httpd*
#cd httpd*
#./configure --prefix=/usr/local/apache2 --enable-modules=so --enable-so --enable-rewrite
#make
여기서 에러
여기서 임시 삽입
6)아파치 configure
#cd /usr/local/apache_1.3.9
#./configure
#cd /usr/local/apache_1.3.9/src
#./Configure
7)php 설치
#cd /usr/local/php-3.0.16
#./configure --with-apache=/usr/local/apache_1.3.9 \
아파치를 지원하겠데요
>--with-gd=/usr/local \
gd를 지원하겠데요
>--with-mysql=/usr/local/mysql \
mysql을 지원하겠데요
>--with-config-file-path=/usr/local/etc/httpd/conf \
config파일의 위치를 지정하네요
>--with-exec-dir=/usr/local/etc/httpd/bin \
실행가능한디렉토리를 지정하네요
>--enable-track-vars=yes
GPC변수들 서버로 전달되는 변수들을 추적하겠다
#make
#make install
8)apache 설치
#cd /usr/local/apache_1.3.9
#./configure --prefix=/usr/local/etc/httpd \
>--activate-module=src/modules/php3/libphp3.a <--이것도 몰르겠당
#make
#make install
9)php설정파일과 php를 아파치에 인식시키기
#cp /usr/local/php-3.0.12 /php3.ini-dist /usr/local/etc/httpd/conf/php3.ini
#vi /usr/local/etc/httpd/conf/httpd/httpd.conf
/index.html
리눅스를 잘하려면 vi편집기를 잘다뤄야 하는데요 초보자에게는 굉장히
불편한 점이 많지만 일단 정이 들었다면 생각하는 데로 모든 명령이
가능하다는 것을 알거에요 /index.html은 /패턴매치라고 해서 index.html과
유사한 구문을 문서 안에서 검색하는 거죠
DirectoryIndex index.html index.php3<-추가
/php3 <--요것도 패턴매치에요
-->주석제거
#AddType application/x-httpd-php3 .php3 .html<-추가
문서내의 주석은 #으로 처리하거든요 주석을 제거하면 해당 라인의 설정이
먹히게 되죠
-->주석제거
#AddType application/x-httpd-php3-source .phps
10)아파치 부팅시 실행 시키기
#cp /usr/local/etc/httpd/bin/apachectl /etc/rc.d/init.d/httpd
#cp /etc/rc.d/rc3.d
#ln -s /etc/rc.d/init.d/httpd ./S85httpd
ln -s 는 링크를 거는 거에요 Windows에 단축아이콘이라고 생각하면 되겠죠
rc.3d 모여있는 링크들은 모두 CML모드로 시작할 때 시작되는 프로그램
링크들이에요 ls -al 해보시면 링크된 것이 ->이렇게 보일 거에요
S(Start라는 뜻입니다.)85httpd <--숫자는 시작순서고요httpd는 대체로 연결된
프로그램명을 적어 주죠
#cd ../rc.5d
#ln -s /etc/rc.d/init.d/httpd ./S85httpd
rc.5d 모여있는 링크들은 모두 X모드로 시작할 때 시작되는 프로그램 링크들이에요
11)mysql 부팅시 실행 시키기
#vi /etc/rc.d/init.d/safe_mysql
작성-> #! /bin/bash
/usr/local/mysql/bin/safe_mysql &
잘봐두세요 바로 쉘스크립트라는 것인데요
(해커즈랩 문제 풀때 꼭 기억해야되는 거에요)
도스에서 일종의 배치파일이라고 생각하시면 되요 safe_mysql을 백그라운드로
실행시키는 쉘스크립트에요
#chmod 700 /etc/rc.d/init.d/safe_mysql
요명령어도 무지 중요하죠, 실행파일로 만드네요
#vi /root/.bashrc
작성-> alias mysql='/usr/local/mysql/bin/mysql'
이것도 중요(에고 안중요한게 없구만 /root/.bashrc라는 파일이 있는데요 여기서는
알리아스(별칭)를 걸어서 긴 명령어를 간단하게 할 수가 있어요)
#source /root/.bashrc
시스템에 변경내용을 알리네요
#cd /etc/rc.d/rc3.d
#ln -s ../init.d/safe_mysql ./S85safe_mysql
#cd ../rc5.d
#ln -s ../init.d/safe_mysql ./S85safe_mysql
그러니까 위의 내용을 정리하면 safe_mysql이라는 쉘스크립트를 만들어서
실행파일로 바꾸고 링크를 걸어서 리눅스가 실행되면 safe_mysql이
백그라운드로 실행되고요 (쉘스크립트내용) mysql이라고만 치면 mysql이
실행되게 해놨네요
자 이제 모든 설치가 끝났습니다.
끝까지 공부하느라고 넘 수고하셨고요 이렇게 공부한 만큼 여러분들의 내공이
상승된다는 것을 잊지 마세요
#make install
-----------------------------------------------
2.3 PHP5 설치
-----------------------------------------------
#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
./configure --with-apache=/usr/local/src/apache_1.3.39 --enable-mailparse
--with-gettext --enable-force-cgi-redirect --with-mysql=/usr/local/mysql
--with-config-file-path=/usr/local/apache/conf
--with-exec-dir=/usr/local/apache/bin --with-jpeg-dir=/usr/local/lib
--with-zlib-dir=/usr/local/lib
--with-gif-dir=/usr/local/lib --with-freetype=/usr/local
--with-gd --with-iconv=/usr --with-tiff --enable-mbstring
--with-ttf=/usr/local/include/freetype2
--with-t1lib --with-png --with-xml --with-dom
--enable-wddx --enable-ftp --enable-dio --enable-ctype
--enable-mime-magic --enable-sockets --enable-track-vars=yes
--enable-sigchild --enable-calendar --enable-bcmatch
--enable-trans-sid --enable-modules=so --enable-gd-native-ttf
--enable-mbregex --with-kerberos --with-regex=php --with-dbm
--with-gdbm --with-ldap --with-mod-charset --with-language=korean
--with-charset=euc_kr --enable-sysvsem=yes --enable-shmop
--enable-magic-quotes --enable-inline-optimization --enable-mailparse
--enable-sysvshm=yes --enable-url-includes --with-track-debug --disable-debug
에러발생시 에러종류1
error: Cannot find OpenSSL's <evp.h>
해결 (1)openssl-devel 패키지 설치확인 -->없으면 설치
#yum -y install openssl-devel
(2)설치되있는데 안될때 ./configure 옵션 마지막에 --with-openssl=/usr/ 추가해본다
에러종류2 DBA: Could not find necessary header file
gdbm-devel 를 설치하여 주면 됩니다
에러종류3
configure: error: utf8_mime2text() has new signature,
but U8T_CANONICAL is missing. This should not happen.
Check config.log for additional information.
uw-imap 과.. uw-imap-devel을 깔아줘야한다.
yum으로 잘 깐다음에 다시 configure --with-imap을 해보면.. 별다른 문제없이 넘어간다.
make 중에 -lltdl이 없다고 에러가 나는데..
이건 libtool-ltdl-devel 패키지를 깔아주면 해결된다
#make
#make install
#cp php.ini-dist /usr/local/php/lib/php.ini
-----------------------------------------------
2.4 ZendOptimizer3 설치
-----------------------------------------------
#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
[출처] APM(Apache2.2.2 + PHP5.1.4 + MySQL5.0.22) + library 설치|작성자 천광우


0