태스트 환경2 : 운영체제 : Ubuntu 9.04(64bit) CPU : Atom 230 x2 RAM : 1GB
필수 사용 라이브러리 :
1. readline 설치 # wget ftp://ftp.cwru.edu/pub/bash/readline-5.2.tar.gz # tar xvzf readline-5.2.tar.gz # cd readline-5.2 # ./configure –enable-multibyte # make Ubuntu 9.04에서는 먼저 gcc랑 make를 설치하셔야 합니다. sudo apt-get install gcc sudo apt-get install make
# sudo make install
readline-5.2.tar.gz 2. expat 설치 ( fontconfig 의존성 라이브러리 ) ( http://sourceforge.net/projects/expat ) # wget http://downloads.sourceforge.net/project/expat/expat/2.0.1/expat-2.0.1.tar.gz # tar xzvf expat-2.0.1.tar.gz # cd expat-2.0.1 # ./configure # make && make install
3. Freetype 설치(Dr.Kiraz 님 제보 - 2009. 10. 4) # wget http://nchc.dl.sourceforge.net/sourceforge/freetype/freetype-2.3.8.tar.gz # tar xvzf freetype-2.3.8.tar.gz # cd freetype-2.3.8 # ./configure # make # make install
freetype-2.3.8.tar.gz 4. libxml2 설치 # wget ftp://xmlsoft.org/libxml2/libxml2-2.7.3.tar.gz # tar xvzf libxml2-2.7.3.tar.gz # cd libxml2-2.7.3 # ./configure \ --with-html --with-http --with-pattern --with-push --with-reader \ --with-regexps --with-threads --with-writer --with-modules \ --with-zlib=/usr/local/include --with-iconv=/usr/local/include # make && make install
libxml2-2.7.3.tar.gz 5. zlib 설치 # wget http://zlib.net/zlib-1.2.5.tar.gz # tar xvzf zlib-1.2.3.tar.gz # cd zlib-1.2.3 # ./configure –s # make # make install
zlib-1.2.3.tar.tar 6. libiconv 설치 # wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.12.tar.gz # tar xvzf libiconv-1.12.tar.gz # cd libiconv-1.12 # ./configure --prefix=/usr/local # make # make install
libiconv-1.12.tar.tar 7. fontconfig 설치 ( XML 폰트 패턴중 알맞는 폰트를 사용자에게 보여주는.. ) ( http://fontconfig.org/release ) # wget http://fontconfig.org/release/fontconfig-2.7.3.tar.gz # tar xzvf fontconfig-2.7.3.tar.gz # cd fontconfig-2.7.3 # ./configure --with-expat=/usr/local/include # make && make install
8. GD 설치 # wget http://www.libgd.org/releases/gd-2.0.35.tar.gz # tar xvzf gd-2.0.35.tar.gz # cd gd-2.0.35 # ./configure # make # make install
gd-2.0.35.tar.gz 9. Curl 설치 # wget http://curl.haxx.se/download/curl-7.19.4.tar.gz # tar xvzf curl-7.19.4.tar.gz # cd curl-7.19.4 # ./configure --prefix=/usr/local/curl # make # make install
curl-7.19.4.tar.gz 10. JPEG 설치 # wget http://www.ijg.org/files/jpegsrc.v7.tar.gz # tar xvzf jpegsrc.v7.tar.gz # cd jpegsrc.v6b.tar.gz # ./configure --prefix=/usr/local/jpeg # make # make install
jpegsrc.v7.tar.gz 11. libpng 설치 # wget http://jaist.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.35.tar.gz # tar xvzf libpng-1.2.35.tar.gz # cd libpng-1.2.35 # ./configure --prefix=/usr/local/png # make # make install
압축 풀어서 생긴(httpd-2.x.xx) 폴더로 이동합니다. cd /usr/local/src/httpd-2.2.11
설치 파일을 위한 환경 설정하기. ./configure --prefix=/usr/local/apache2 --enable-mods-shared=all --enable-so --enable-ssl --enable-modules=ssl --enable-rewrite --with-mpm=prefork
설치 make && make install
서비스 등록 cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd vi /etc/init.d/httpd
오류 발생시 1. configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information. #apt-get install libc_client* #yum -y install libc_client*
PHP 환경 설정 복사하기 (/etc/) cp php.ini-production /usr/local/apache2/conf/php.ini (Php 5.3)
PHP 설치 : ./configure 중 libiconv.so.2 문제
문제
Sorry, I cannot run apxs. Possible reasons follow:
1. Perl is not installed 2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs 3. Apache was not built using --enable-so (the apxs usage page is displayed)
The output of /opt/modules/apache2/bin/apxs follows: /opt/modules/apache2/bin/httpd: error while loading shared libraries:libiconv.so.2: cannot open shared object file: No such file or directory apxs:Error: Sorry, no shared object support for Apache. apxs:Error: available under your platform. Make sure. apxs:Error: the Apache module mod_so is compiled into. apxs:Error: your server binary `/opt/modules/apache2/bin/httpd'.. configure: error: Aborting
해결 방법
# ln -s /usr/local/lib/libiconv.so.2 /usr/lib/
다시 configure 실행
php컴파일 후 /usr/bin/ld:cannot find-lltdl에러 발생시
libmcrypt-2.x.x/libltd 폴더로 이동한다.
# ./configure --enable-ltdl-install # make # make install
Install 스크립트 - 자동으로 설치함 - 설치 중 php.ini 경로 입력 : /usr/local/php/lib - 설치 중 Apache Control Utility 경로 입력 : /usr/local/apache2/bin/apachectl
Zend Optimizer 제거 - /usr/local/php/lib/php.ini-zend_optimizer.bak 을 php.ini로 바꿈
임시 해결 방법 : PHP5 모듈 - gzopen64 오류
오류1. apache2: Syntax error on line 185 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/php5.load: Cannot load /usr/lib/apache2/modules /libphp5.so into server: /usr/lib/libxml2.so.2: undefined symbol: gzopen64
해결 방법
# vim /etc/ld.so.conf.d/libc.conf
# libc default configuration /usr/local/lib
↓
# libc default configuration #/usr/local/lib
# /sbin/ldconfig
참고 : ldconfig는 runtime때 여러 위치에 존재하는 shared object, 쉽게말해 동적 라이브러리를 연결해주는 dynamic linker의 설정프로그램이라고 보시면 됩니다. 여기서 runtime dynamic linker는 /lib/ld.so 를 말하는 겁니다. 어떤 shared object가 필요한지는 실행파일이 말해줍니다.
아파치 재시작 # /etc/init.d/httpd reload
오류2.
httpd: Syntax error on line 53 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules cannot restore segment prot after reloc: Permission denied