키키호의 블로그

[CentOS] Apache 설치 본문

Linux/Apache

[CentOS] Apache 설치

kikiho 2014. 1. 12. 17:43



1. 컴파일 준비

yum install -y gcc

yum install -y zlib-devel openssl-devel libxml12-devel libjpeg-devel libpng-devel



2. 컴파일 순서

wget -O- http://apache.tt.co.kr//httpd/httpd-2.2.26.tar.bz2 | tar xvfj - -C /tmp/


./configure --prefix=/usr/local/apache2 --enable-mods-shared=all --enable-so --with-mpm=worker --enable-ssl --with-ssl 


 ./configure --prefix=/usr/local/apache2 --enable-mods-shared=most --enable-module=so --enable-rewrite --with-mpm=worker  --enable-ssl --enable-so


--prefix= : 옵션은 컴파일된 파일이 설치될 경로를 지정
--enable-mods-shared=all : 모든 아파치 모듈을 생성하라는 옵션
--enable-so : 아파치에 DSO 방식으로 모듈을 적재되도록 하는 옵션

컴파일 후 생성되는 모듈은 --prefix= 옵션으로 지정한 경로의 modules 디렉토리에 생성된다.

TroubleShooting 
 1.  만약 checking for gcc.. nochecking for cc.. nochecking forcl.exe 등 오류의 발생은 컴파일러에 필요한 도구가 설치되어 있지 않기 때문에 발생되는 에러입니다. [yum install gcc] 를 통하여 설치를 해주면 된다.

 2. 64비트 시스템에서 libexpat.so 모듈 컴파일 오류가 발생할때
libexpat.so 모듈의 심볼릭 링크를 다음과 같이 올바르게 연결시켜 주고, configure 명령에
--enable-lib64 --libdir=/usr/lib64옵션을 추가해 주어야 한다.
ln -sf /lib64/libexpat.so.0.5.0 /usr/lib/libexpat.so

Make 명령으로 소스 컴파일
make
make install




Comments