nginx 컴 파일 설치 1.17.3 버 전, openssl 매개 변수 오류 해결 추가

3326 단어
배경
    최근 nginx 1.14.1 에서 nginx 1.17.3 버 전 으로 업그레이드 할 때 openssl 의 오류 가 발견 되 었 습 니 다. 문제 의 발생 과 해결 과정 을 기록 하여 참고 하 시기 바 랍 니 다.
문제.
    nginx 를 업그레이드 할 때 저 는 관례 에 따라 원래 버 전의 컴 파일 파 라 메 터 를 사용 하여 1. 17.3 새 버 전의 컴 파일 을 진행 합 니 다. 다음 과 같 습 니 다.
# /usr/local/nginx/sbin/nginx -V
      :
--prefix=/usr/local/nginx --with-http_ssl_module --with-openssl=/usr/local/openssl --with-http_stub_status_module --with-http_dav_module --with-http_realip_module --with-http_gzip_static_module --with-http_v2_module

     이전 버 전의 컴 파일 파 라 메 터 를 이용 하여 새 버 전 nginx, make 를 컴 파일 할 때 오류 가 발생 했 습 니 다. 작업 과 정 보 는 다음 과 같 습 니 다.
# tar -zxvf nginx-1.17.3.tar.gz
# cd nginx-1.17.3
# ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-openssl=/usr/local/openssl --with-http_stub_status_module --with-http_dav_module --with-http_realip_module --with-http_gzip_static_module --with-http_v2_module
# make
make -f objs/Makefile
make[1]: Entering directory `/root/soft/nginx-1.17.3'
cd /usr/local/openssl \
&& if [ -f Makefile ]; then make clean; fi \
&& ./config --prefix=/usr/local/openssl/.openssl no-shared no-threads  \
&& make \
&& make install_sw LIBDIR=lib
/bin/sh: line 2: ./config: No such file or directory
make[1]: *** [/usr/local/openssl/.openssl/include/openssl/ssl.h] Error 127
make[1]: Leaving directory `

    오류 메 시 지 를 보면 컴 파일 은 openssl 과 관련 된 구성 요소 가 잘못 되 었 습 니 다. '- with - openssl = / usr / local / openssl' 이라는 매개 변수 로 인해 발생 할 수 있 습 니 다."/ usr / local / openssl /. openssl / include / openssl / ssl. h" 라 는 파일 이 언급 되 었 습 니 다. 이 파일 을 찾 아 보 니 파일 을 찾 을 수 없습니다. (/ usr / local / openssl 은 제 가 설치 한 openssl 입 니 다)
# ll /usr/local/openssl/.openssl/
ls: cannot access /usr/local/openssl/.openssl/: No such file or directory

    'openssl' 이라는 디 렉 터 리 자체 가 존재 하지 않 는 것 을 발견 할 수 있 습 니 다. nginx 1.17.3 버 전 으로 컴 파일 될 때 기본적으로 '/ usr / local / openssl / openssl /' 이라는 디 렉 터 리 를 찾 았 기 때문에 make 에 실 패 했 습 니 다.
해결 하 다.
     문제 가 가능 한 원인 을 발견 한 후, nginx 1.17.3 openssl 모듈 을 추가 할 때 관련 컴 파일 정보 (auto / lib / openssl / conf) 를 수정 해 보십시오.
# vi auto/lib/openssl/conf
            CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
            CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
            CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
            CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
            
//     ,  openssl core    ,      .openssl    ,        ,  .openssl    :   
# more auto/lib/open/ssl
            CORE_INCS="$CORE_INCS $OPENSSL/include"
            CORE_DEPS="$CORE_DEPS $OPENSSL/include/openssl/ssl.h"
            CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libssl.a"
            CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libcrypto.a"

      auto / lib / openssl / conf 의 정 보 를 수정 한 후 nginx 1.17.3 을 다시 컴 파일 하여 설치 에 성공 할 수 있 습 니 다.
# make clean
# ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-openssl=/usr/local/openssl --with-http_stub_status_module --with-http_dav_module --with-http_realip_module --with-http_gzip_static_module --with-http_v2_module
# make && make install

좋은 웹페이지 즐겨찾기