http://cafe.naver.com/q69/114530

OS : Fedora Core 4, CentOS 5.0
MySql 4.1.18  http://ftp.superuser.co.kr/pub/mysql/my ··· 8.tar.gz
Apache 2.0.55  http://ftp.superuser.co.kr/pub/apache/h ··· 5.tar.gz
PHP 4.4.2  http://ftp.superuser.co.kr/pub/php/php-4.4.2.tar.gz
Zend-Optimizer 3.0.1 http://ftp.superuser.co.kr/pub/zendopti ··· 6.tar.gz


1. MySQL 설치

# ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --with-charset=euckr --enable-thread-safe-client

아래와 같은 에러메시지가 나오는 경우가 있다.

1. checking for termcap functions library... configure: error: No curses/termcap library found

이는 아래 명령어로 해결된다.
# yum -y install ncurses-devel


2. configure: error: C++ preprocessor "/lib/cpp" fails sanity check

그 이유는

gcc-c++
glibdc-devel
위 두 개의 패키지가 없어서 그런 것이므로

# yum install gcc-c++  (의존성으로 인해 알아서 glibdc-devel 도 설치된다. 안되면 따로 설치)

그리고 --with-charset=euckr 옵션의 경우 MySQL 4.x 이하 버전의 경우는 euc_kr, 그 이상은 euckr로 한다. 이거 중요함.

MySQL has a Web site at http://www.mysql.com/ which carries details on the
latest release, upcoming features, and other information to make your
work or play with MySQL more productive. There you can also find
information about mailing lists for MySQL discussion.


Remember to check the platform specific part of the reference manual for
hints about installing MySQL on your platform. Also have a look at the
files in the Docs directory.


Thank you for choosing MySQL!

위와 같은 메시지가 마지막에 나오면 이제 컴파일하면 된다.


# make
# make install
# /usr/local/mysql/bin/mysql_install_db
# useradd -M mysql
# chown -R mysql.mysql /usr/local/mysql/data
# /usr/local/mysql/bin/mysqld_safe &
# /usr/local/mysql/bin/mysqladmin -u root password 비밀번호 <- root 비밀번호 설정

시스템을 시작할 때마다 mysqld 데몬을 자동으로 올라오게 하려면 아래와 같이 작업해 준다.

# cp /usr/local/mysql/share/mysql/mysql.server /etc/rc.d/init.d/mysqld
# chkconfig --add mysqld
 
 

2. Apache 설치

# ./configure --prefix=/usr/local/apache --enable-so --with-mpm=worker --enable-rewrite
# make
# make install



3. PHP 설치

컴파일 환경설정을 하기 전에 에러메시지에 대비해서 미리 깔아두어야 할 패키지부터 깔아 놓자. PHP의 경우는 아래와 같이 선행되어 깔려 있어야 할 패키지가 여럿 된다.

zlib, libpng, freetype, jpeg, gd, libxml2

# yum -y install flex


zlib 추가 - zlib은 yum 업데이트로 쉽게 해결된다.

# yum -y install zlib-devel


libpng 추가

# wget http://ftp.superuser.co.kr/pub/tools/li ··· 8.tar.gz
# tar xvfz libpng-1.0.8.tar.gz
# cd libpng-1.0.8
# cp scripts/makefile.linux makefile
# make test
# make install


freetype 추가

# wget http://download.savannah.gnu.org/releases/freetype/freetype-2.2.1.tar.gz
# tar xvfz freetype-2.2.1.tar.gz
# cd freetype-2.2.1
# ./configure && make && make install


jpeg 추가

# wget http://graphics.cs.uni-sb.de/nmm/downlo ··· b.tar.gz
# tar xvfz jpegsrc.v6b.tar.gz
# cd jpegsrc.v6b
# ./configure --enable-shared --enable-static
# make
# mkdir -p /usr/local/man/man1
# make install


이제 본격적으로 설치 작업에 들어가면 된다.


# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-zlib --with-gd --with-ttf --with-png --with-expat-dir=/usr --with-gmp --with-xml --with-language=korean --with-charset=euc_kr --disable-debug --disable-rpath --with-iconv --enable-safe-mode --enable-magic-quotes --enable-bcmath --enable-dio --enable-gd-native-ttf --enable-sysvsem --enable-sysvshm --enable-wddx --enable-pic --enable-inline-optimization --enable-mbstring --enable-mbregex --enable-mbstr-enc-trans --with-config-file- --enable-ftp --disable-debug --enable-track-vars=yes --with-jpeg-dir --with-freetype-dir --enable-gd-native-ttf --enable-dl --enable-gd-imgstrttf --enable-exif --with-mysql=/usr/local/mysql --enable-versioning



아래와 같은 메시지가 나오면 컴파일할 준비가 완료된 상태임을 뜻한다.


+--------------------------------------------------------------------+
|                          *** NOTE ***                              |
|            The default for register_globals is now OFF!            |
|                                                                    |
| If your application relies on register_globals being ON, you       |
| should explicitly set it to on in your php.ini file.               |
| Note that you are strongly encouraged to read                      |
| http://www.php.net/manual/en/security.globals.php                  |
| about the implications of having register_globals set to on, and   |
| avoid using it if possible.                                        |
+--------------------------------------------------------------------+


#make
#make install
#cp php.ini-dist /usr/local/lib/php.ini

그 다음 웹페이지 상에서 php코드를 해석할 수 있게 /usr/local/apache/conf/httpd.conf 파일을 수정해 주어야 한다.
837, 838행을 보면 아래와 같이 되어 있다.

AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

839행에 아래 내용을 추가해 주면 된다.

AddType application/x-httpd-php .htm .html .php .ph php3 .php4 .phtml .inc


4. Zend Optimizer

./install.sh