ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [Apache]아파치 컴파일 설치(Apahce-2.4.38)
    WEB/Apache 2021. 12. 19. 17:21

    Apache 컴파일 설치하기

    설치환경

    VirtualBox

    CentOS7.6

    yum 사용가능

     


    1. 아파치 tar.gz 파일 압출풀기

    [root@test_was01 src]# pwd
    /src
    [root@test_was01 src]# ls
    httpd-2.4.38.tar.gz
    [root@test_was01 src]# tar xzvf httpd-2.4.38.tar.gz


    2. 디렉토리 이동 후 컴파일 파일 생성

    [root@test_was01 src]# pwd
    /src
    [root@test_was01 src]# ls
    httpd-2.4.38  httpd-2.4.38.tar.gz
    [root@test_was01 src]# cd httpd-2.4.38
    [root@test_was01 httpd-2.4.38]# vim config.nice


    config.nice 파일 내용 예시

    #! /bin/sh
    #
    # Created by configure
    
    "./configure" \
    "--prefix=/WEB/apache-2.4.38" \
    "--with-mpm=prefork" \
    "--enable-so" \
    "--enable-rewrite" \
    "$@"



    3. 아파치 컴파일  명령 실행

    [root@test_was01 httpd-2.4.38]# pwd
    /src/httpd-2.4.38
    [root@test_was01 httpd-2.4.38]# sh config.nice

     

     

    * 에러발생

    ===============================================================
    checking for APR-util... no
    configure: error: APR-util not found.  Please read the documentation.

    1.apr-util 설치 확인 및 설치

    [root@test_was01 httpd-2.4.38]# rpm -qa |grep apr-util


    2. 설치가 되어 있지 않을 경우 yum 으로 설치

    [root@test_was01 httpd-2.4.38]# yum install -y apr-util

     

     

    3. apr-util 설치 후 다시 컴파일 명령어 실행

    [root@test_was01 httpd-2.4.38]# sh config.nice
    
    checking for APR-util... no
    configure: error: APR-util not found.  Please read the documentation.


    4. apr-util-devel 설치 확인

    [root@test_was01 httpd-2.4.38]# rpm -qa |grep apr
    apr-devel-1.4.8-3.el7_4.1.x86_64
    apr-util-1.5.2-6.el7.x86_64
    apr-1.4.8-3.el7_4.1.x86_64
    -> apr-util 설치시 관련 의존성으로 위에 패키지 같이 설치 됨


    5. apr-util-devel 추가 설치

    [root@test_was01 httpd-2.4.38]# yum install -y apr-util-devel
    [root@test_was01 build]# rpm -qa |grep apr
    apr-devel-1.4.8-3.el7_4.1.x86_64
    apr-util-1.5.2-6.el7.x86_64
    apr-util-devel-1.5.2-6.el7.x86_64
    apr-1.4.8-3.el7_4.1.x86_64


    6. 다시 컴파일 실행

    [root@test_was01 httpd-2.4.38]# sh config.nice
    checking for gcc... gcc
    checking whether the C compiler works... no
    configure: error: in `/src/httpd-2.4.38':
    configure: error: C compiler cannot create executables


    7. gcc 설치 하기

    [root@test_was01 httpd-2.4.38]# yum install gcc
    [root@test_was01 httpd-2.4.38]# sh config.nice
    checking how to run the C preprocessor... gcc -E
    checking for gcc option to accept ISO C99... -std=gnu99
    checking for pcre-config... false
    configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/


    8. pcre-devel 설치

    [root@test_was01 httpd-2.4.38]# yum install -y pcre-devel


    9. 다시 컴파일 실행 -->> 컴파일 완료

    [root@test_was01 httpd-2.4.38]# sh config.nice
    
    config.status: executing default commands
    configure: summary of build options:
    
        Server Version: 2.4.38
        Install prefix: /WEB/apache-2.4.38
        C compiler:     gcc -std=gnu99
        CFLAGS:           -pthread
        CPPFLAGS:        -DLINUX -D_REENTRANT -D_GNU_SOURCE
        LDFLAGS:
        LIBS:
        C preprocessor: gcc -E
    
    [root@test_was01 httpd-2.4.38]#

    ===============================================================

     



    4. make 명령실행

    [root@test_was01 httpd-2.4.38]# make
    ~~~~~~~~~~~~~~
    -o mod_rewrite.la -rpath /WEB/apache-2.4.38/modules -module -avoid-version  mod_rewrite.lo
    make[4]: Leaving directory `/src/httpd-2.4.38/modules/mappers'
    make[3]: Leaving directory `/src/httpd-2.4.38/modules/mappers'
    make[2]: Leaving directory `/src/httpd-2.4.38/modules'
    make[2]: Entering directory `/src/httpd-2.4.38/support'
    make[2]: Leaving directory `/src/httpd-2.4.38/support'
    
    make[1]: Leaving directory `/src/httpd-2.4.38'
    
    [root@test_was01 httpd-2.4.38]#

    5. make install 명령실행

    [root@test_was01 httpd-2.4.38]# make install
    ~~~~~~~~~~~~
    
    mkdir /WEB/apache-2.4.38/man
    mkdir /WEB/apache-2.4.38/man/man1
    mkdir /WEB/apache-2.4.38/man/man8
    mkdir /WEB/apache-2.4.38/manual
    make[1]: Leaving directory `/src/httpd-2.4.38'
    [root@test_was01 httpd-2.4.38]#


    6. 아파치 설치 디렉토리로 이동 후 실행

    [root@test_was01 httpd-2.4.38]# cd /WEB/apache-2.4.38/bin/
    [root@test_was01 bin]# ./apachectl start
    AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.11.11. Set the 'ServerName' directive globally to suppress this message
    -->> 서버네임이 지정되어있지않아서 나오는 말 우선은 그냥 진행


    7. 아파치 프로세스 확인

    [root@test_was01 bin]# ps -ef |grep httpd

     

     

    2021-12-19 수정

    댓글

Designed by Tistory.