본문 바로가기

LINUX & UNIX

Apache2, PHP4 소스 컴파일 설치 ( CentOS5 )

반응형


# Apache2 설치
Apache 다운로드
wget http://ftp.kaist.ac.kr/pub/Apache/httpd/httpd-2.2.4.tar.gz

설정

./configure --prefix=/usr/local/httpd-2.2.4 --enable-rule=SHARED_CORE --enable-so --enable-shared=max --enable-unique-id

make && make install

ln -s /usr/local/httpd-2.2.4 /usr/local/apache (나중에 새로 설치시 에러 대비)

# PHP4 설치
php다운로드 wget http://kr2.php.net/distributions/php-4.4.9.tar.bz2

tar xvf php-4.4.7.tar.bz2

설치전 설치되어있어야할 패키지
ncurse , flex , gmp-devel , zlib, libjpeg, libpng, freetype, gd, gd-devel, gd-progs

설정
configure 시 --enable-versioning 옵션이 포함 되면 Failed loading ZendExtensionManager.so 에러를 만나게 된다

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/httpd-2.2.4/bin/apxs --with-zlib --with-gd --with-ttf --with-jpeg-dir --with-png-dir --with-gmp --with-expat --with-xml --with-mysql=/usr/local/mysql --with-language=korean --with-charset=euc_kr --disable-debug --disable-posix --disable-rpath --enable-safe-mode --enable-magic-quotes --disable-dmalloc --enable-bcmath --enable-dio --enable-gd-native-ttf --enable-sysvsem --enable-sysvshm --enable-wddx  --enable-pic --enable-inline-optimization --enable-memory-limit --enable-mbstring --enable-mbregex --enable-mbstr-enc-trans --with-config-file --enable-ftp --enable-track-vars=yes --with-freetype-dir --enable-dl --enable-session --enable-sockets --enable-tokenizer --with-kerberos --with-iconv

make && make install

환경설정파일 복사
cp php.ini-recommended /usr/local/php/lib/php.ini

(SELinux와 충돌해결)
libphp4.so: cannot restore segment prot after reloc: Permission denied

restorecon -v libphp4.so
chcon -t texrel_shlib_t libphp4.so
또는 SELinux를 꺼버린다.

Zend Optimizer 설치
http://www.zend.com 에서 다운로드
tar xvfz ZendOptimizer-3.2.8-linux-glibc21-i386.tar.gz
./install.shOK -> EXIT -> YES -> 설치경로지정(/usr/local/Zend) -> php.ini 위치지정 (/usr/local/php/lib) -> yes
설치완료..!

apache 자동실행
apachectl 링크만들기
ln -s /usr/local/apache/bin/apachectl  /etc/rc.d/init.d/
/etc/rc.d/init.d/apachectl
수정
vi /etc/rc.d/init.d/apachectl
상단에 추가
# chkconfig: - 92 92
# description: Apache Web Server Version 2.2.4
chkconfig --add apachectl
chkconfig --level 2345 apachectl on

ntsysv로 확인

httpd.conf 에 아래 라인을 추가

AddType text/html .php
AddType application/x-httpd-php .php .html .php3 .htm

php 파싱 하고 싶은 확작명을 스패이스 로 분리해서 입력 한다.

반응형