2015년 11월 26일 목요일

리눅스 아파치 최신버전 설치 (컴파일)

리눅스 아파치 최신버전 설치 (컴파일)

 

컴파일 설치 준비

16px-Crystal_Clear_app_xmag.svg.png 리눅스 컴파일 설치 준비 문서를 참고하십시오.

최신버전 다운로드

  • http://httpd.apache.org/download.cgi 접속
  • Stable Release - Lasted Version 아래의 버전 확인(예: 2.4.9) 후 클릭
  • Source: 오른쪽의 bz2 파일 링크(예: httpd-2.4.9.tar.bz2) 클릭하여 다운로드

다운로드

cd /usr/local/src
wget http://ftp.neowiz.com/apache/httpd/httpd-2.4.17.tar.bz2
wget http://ftp.neowiz.com/apache/apr/apr-1.5.2.tar.bz2
wget http://ftp.neowiz.com/apache/apr/apr-util-1.5.4.tar.bz2
wget http://downloads.sourceforge.net/project/pcre/pcre/8.33/pcre-8.33.tar.bz2
→ 다운로드 안되면 http://ftp.neowiz.com/apache/httpd 에서 버전 및 URL 확인
[root@zetawiki src]# ll
total 7772
-rw-r--r--. 1 root root  826885 2015-04-29 09:37 apr-1.5.2.tar.bz2
-rw-r--r--. 1 root root  694427 2014-09-20 20:59 apr-util-1.5.4.tar.bz2
-rw-r--r--. 1 root root 1532608 2015-10-13 02:42 httpd-2.4.17.tar.bz2
-rw-r--r--. 1 root root 1440869 2013-05-30 01:19 pcre-8.33.tar.bz2
[root@zetawiki src]#

압축 해제

tar xvf apr-1.5.2.tar.bz2
tar xvf apr-util-1.5.4.tar.bz2
tar xvf httpd-2.4.17.tar.bz2
tar xvf pcre-8.33.tar.bz2
mv apr-1.5.2 ./httpd-2.4.17/srclib/apr
mv apr-util-1.5.4 ./httpd-2.4.17/srclib/apr-util
[root@zetawiki ~]# tar xvf apr-1.5.0.tar.bz2
... (생략)
apr-1.5.0/encoding/
apr-1.5.0/encoding/apr_escape.c
[root@zetawiki ~]# tar xvf apr-util-1.5.3.tar.bz2
... (생략)
apr-util-1.5.3/encoding/
apr-util-1.5.3/encoding/apr_base64.c
[root@zetawiki ~]# tar xvf httpd-2.4.7.tar.bz2
... (생략)
httpd-2.4.7/build/aix/mkinstallp.ksh
httpd-2.4.7/build/aix/README
[root@zetawiki ~]# tar xvf pcre-8.33.tar.bz2
... (생략)
pcre-8.33/makevp_c.txt
pcre-8.33/pcredemo.c
[root@zetawiki src]# ll
total 7788
drwxr-xr-x. 27 1000  1000    4096 Nov 13 08:14 apr-1.5.0
-rw-r--r--.  1 root root   813976 Nov 16 09:50 apr-1.5.0.tar.bz2
drwxr-xr-x. 19 1000  1000    4096 Nov 13 08:41 apr-util-1.5.3
-rw-r--r--.  1 root root   695303 Nov 16 09:52 apr-util-1.5.3.tar.bz2
drwxr-xr-x. 11  501 games    4096 Nov 19 09:36 httpd-2.4.7
-rw-r--r--.  1 root root  5004719 Nov 22 09:49 httpd-2.4.7.tar.bz2
drwxr-xr-x.  7 1169  1169    4096 May 28 02:14 pcre-8.33
-rw-r--r--.  1 root root  1440869 May 28 01:16 pcre-8.33.tar.bz2
[root@zetawiki src]# mv apr-1.5.0 ./httpd-2.4.7/srclib/apr
[root@zetawiki src]# mv apr-util-1.5.3 ./httpd-2.4.7/srclib/apr-util
[root@zetawiki src]# ll
total 7780
-rw-r--r--.  1 root root   813976 Nov 16 09:50 apr-1.5.0.tar.bz2
-rw-r--r--.  1 root root   695303 Nov 16 09:52 apr-util-1.5.3.tar.bz2
drwxr-xr-x. 11  501 games    4096 Nov 19 09:36 httpd-2.4.7
-rw-r--r--.  1 root root  5004719 Nov 22 09:49 httpd-2.4.7.tar.bz2
drwxr-xr-x.  7 1169  1169    4096 May 28 02:14 pcre-8.33
-rw-r--r--.  1 root root  1440869 May 28 01:16 pcre-8.33.tar.bz2

pcre 설치

cd /usr/local/src/pcre-8.33
./configure
make
make install
[root@zetawiki ~]# cd /usr/local/src/pcre-8.33
[root@zetawiki pcre-8.33]# ./configure
... (생략)
    Link pcretest with libreadline .. : no
    Valgrind support ................ : no
    Code coverage ................... : no
[root@zetawiki pcre-8.33]# make
... (생략)
  CXX      pcre_stringpiece_unittest-pcre_stringpiece_unittest.o
  CXXLD    pcre_stringpiece_unittest
make[1]: Leaving directory `/usr/local/src/pcre-8.33'
[root@zetawiki pcre-8.33]# make install
make[3]: Leaving directory `/usr/local/src/pcre-8.33'
make[2]: Leaving directory `/usr/local/src/pcre-8.33'
make[1]: Leaving directory `/usr/local/src/pcre-8.33'

아파치 설치

cd /usr/local/src/httpd-2.4.17
./configure --prefix=/usr/local/apache2
make
make install
--prefix=/usr/local/apache2에 있는대로 /usr/local/apache2가 아파치 홈 폴더가 된다.[1]
configure: error: Cannot use an external APR-util with the bundled APR 오류 발생하면[2] ./configure --prefix=/usr/local/httpd --with-included-apr를 해보자.
[root@zetawiki pcre-8.33]# cd /usr/local/src/httpd-2.4.17
[root@zetawiki httpd-2.4.17]# ./configure --prefix=/usr/local/apache2
... (생략)
config.status: creating build/config_vars.sh
config.status: creating include/ap_config_auto.h
config.status: executing default commands
[root@zetawiki httpd-2.4.17]# make
... (생략)
make[2]: Leaving directory `/usr/local/src/httpd-2.4.17/support'
 
make[1]: Leaving directory `/usr/local/src/httpd-2.4.17'
[root@zetawiki httpd-2.4.17]# make install
... (생략)
mkdir /usr/local/apache2/man/man8
mkdir /usr/local/apache2/manual
make[1]: Leaving directory `/usr/local/src/httpd-2.4.17'

아파치 시작

[root@zetawiki ~]# /usr/local/apache2/bin/httpd -k start
[root@zetawiki ~]# ps -ef | grep httpd | grep -v grep
root     35683     1  0 17:09 ?        00:00:00 /usr/local/apache2/bin/httpd -k start
daemon   35684 35683  0 17:09 ?        00:00:00 /usr/local/apache2/bin/httpd -k start
daemon   35685 35683  0 17:09 ?        00:00:00 /usr/local/apache2/bin/httpd -k start
daemon   35686 35683  0 17:09 ?        00:00:00 /usr/local/apache2/bin/httpd -k start
[root@zetawiki ~]# netstat -anp | grep httpd
tcp        0      0 :::80                       :::*                        LISTEN      35683/httpd
[root@zetawiki ~]# curl http://127.0.0.1
<html><body><h1>It works!</h1></body></html>

방화벽 끄기

[root@zetawiki ~]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED 
ACCEPT     icmp --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh 
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited 
 
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited 
 
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
[root@zetawiki ~]# lokkit --selinux=disabled --disabled
[root@zetawiki ~]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
 
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
 
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
 
출처: http://zetawiki.com/wiki/%EB%A6%AC%EB%88%85%EC%8A%A4_%EC%95%84%ED%8C%8C%EC%B9%98_%EC%BB%B4%ED%8C%8C%EC%9D%BC_%EC%84%A4%EC%B9%98
아파치 컴파일 설치에 관하여 가장 깔끔하게 설명되어 있다.
 
 
참조 http://blog.naver.com/spaper/220319833578

댓글 없음:

댓글 쓰기

vsftpd FTP 서버 접속은 성공하였으나, "디렉토리 목록 조회 실패" 현상 발생시

FTP Passive 모드를 활성화 필요. 1. vsftpd 설정 변경 /etc/vsftpd/vsftpd.conf 상에 아래 내용 추가 기입 #passive modpasv_enable=YES pasv_min_port=5001 pasv...