서버

[ubuntu] apache 서버 소스코드 설치

App.SHIN 2017. 4. 10. 23:16

document 가 많은 ubuntu를 사용하고 

apt-get을 이용한 apache2를 설치할수도 있는데 알고있으면 쉽겠지만 어디든 자동으로 설정파일들이 생성되고 이러는게 짜증나서.

소스코드로 apache를 설치해보려고 한다.


우선 google에 apache httpd download를 치면 

https://httpd.apache.org/download.cgi


apache 사이트가나오는데  이글쓸때 기준 가장 최신버전으로설치를 해보려고한다.

Apache HTTP Server 2.4.25 (httpd): 2.4.25 is the latest available version 2016-12-20




tar.gz 부분 링크주소 복사를한뒤


wget http://mirror.navercorp.com/apache//httpd/httpd-2.4.25.tar.gz 을 하면 

다운받는다 원하는곳에 풀고 


configure 실행


root@/env/httpd-2.4.25# ./configure 

checking for chosen layout... Apache

checking for working mkdir -p... yes

checking for grep that handles long lines and -e... /bin/grep

checking for egrep... /bin/grep -E

checking build system type... x86_64-unknown-linux-gnu

checking host system type... x86_64-unknown-linux-gnu

checking target system type... x86_64-unknown-linux-gnu

configure: 

configure: Configuring Apache Portable Runtime library...

configure: 

checking for APR... no

configure: error: APR not found.  Please read the documentation.

root@/env/httpd-2.4.25# 



APR 이없다고 하고 document를 읽어보라고 하네요.
document를 열고 find 로 찾아봤자 없네요 commnet 부분에 누가 써놓은게 다인데 아 apache document 발로만들었나



구글신에게 물어보니 apache configure apr not found

바로 나오네요 




APR lib 를 설치해야하네요.

에효 뭐 깔게이리많은지

https://apr.apache.org/download.cgi


APR 과 APR-util을 이용해서 설치합니다.

각각 파일을 다운받은뒤

configure

make 

make install합니다.


APR-UTIL을 configure 할때는

./configure --with-apr=/env/apr-1.5.2


apr 설치 했는 폴더경로를 줘야하네요

이제 드뎌 설치하나했더니



configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/


찾아보니 pcre-config 를 설치해야합니다.

ubuntu 에서는


apt-get install libpcre3-dev


./configure --prefix=설치경로


make


make install 


하면 끝


cd 설치경로/bin

httpd -k start 


http://ip주소 브라우저에서 입력하시면 

it works 확인하실수있습니다.