본문 바로가기
Infra & Server Dev

CentOS 6.4[64bit] 아파치 최신 버전 설치

by 필팔청춘 2014. 7. 18.


다운로드

cd /usr/local/src

wget -N http://apache.mirror.cdnetworks.com/httpd/httpd-2.4.12.tar.bz2

wget -N http://apache.mirror.cdnetworks.com/apr/apr-1.5.2.tar.bz2

wget -N http://apache.mirror.cdnetworks.com/apr/apr-util-1.5.4.tar.bz2

wget -N http://ftp.cs.stanford.edu/pub/exim/pcre/pcre-8.37.tar.bz2


압축해제

tar xvf apr-1.5.2.tar.bz2 

tar xvf apr-util-1.5.4.tar.bz2 

tar xvf httpd-2.4.12.tar.bz2 

tar xvf pcre-8.37.tar.bz2 

mv apr-1.5.2 ./httpd-2.4.12/srclib/apr

mv apr-util-1.5.4 ./httpd-2.4.12/srclib/apr-util



pcre 설치

cd /usr/local/src/pcre-8.37

./configure

make

make install


참고사항

./configure에서 gcc 또는 gcc-c++가 설치 안되어 있을때 오류가 납니다.

오류내용 

case1 :

configure: error: in `/usr/local/src/pcre-8.37':

configure: error: no acceptable C compiler found in $PATH

case2 :

configure: error: You need a C++ compiler for C++ support.

gcc, gcc-c++ 설치는 yum으로 간단하게 하세요.

yum -y install gcc gcc-c++


아파치 설치

cd /usr/local/src/httpd-2.4.12

./configure --prefix=/usr/local/apache2 --with-mpm=prefork --with-included-apr

make

make install


아파치 시작 및 확인

/usr/local/apache2/bin/httpd -k start

ps -ef | grep httpd | grep -v grep

netstat -anp | grep httpd

curl http://127.0.0.1


아파치 Service 등록

cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd 


아파치 로딩 경로

vi /usr/local/apache2/conf/httpd.conf

DocumentRoot "/usr/local/apache2/htdocs"

<Directory "/usr/local/apache2/htdocs">


본 포스팅은 다음 링크들을 참고하여 만들었습니다.

http://jmnote.com/wiki/%EB%A6%AC%EB%88%85%EC%8A%A4_%EC%95%84%ED%8C%8C%EC%B9%98_%EC%B5%9C%EC%8B%A0%EB%B2%84%EC%A0%84_%EC%84%A4%EC%B9%98_(%EC%BB%B4%ED%8C%8C%EC%9D%BC)

http://blog.acu.pe.kr/28

http://junemoon.tistory.com/30 

- http://firedev.tistory.com/entry/CentOS-apache-service-%EB%93%B1%EB%A1%9D

http://blog.wincomi.com/235