nginx 동적 추가 확장 모듈

2184 단어 Nginx
설명 하 다.
설 치 된 nginx 는 컴 파일 되 지 않 은 모듈 을 추가 해 야 합 니 다. 어떻게 해 야 합 니까?
구체 적
여 기 는 제3자 echo - nginx - module 모듈 을 설치 하 는 것 을 예 로 들 어 nginx 설정 파일 변수 출력 에 사용 되 며 설정 정 보 를 쉽게 볼 수 있 습 니 다 =
nginx 모듈 은 nginx 를 다시 컴 파일 해 야 합 니 다. 아파 치 처럼 파일 도입 을 설정 하 는 것 이 아 닙 니 다 (. so)
제3자 확장 모듈 echo - nginx - module 다운로드 (지정 한 폴 더 에 압축 을 풀 고 컴 파일 할 때 경로 가 가리 키 는 것)
# cd /root/Downloads/ 
# wget  https://github.com/openresty/echo-nginx-module/archive/v0.60.tar.gz
# tar zxvf v0.60.tar.gz

nginx 이전 컴 파일 설치 시 어떤 모듈 이 설치 되 어 있 는 지 확인 합 니 다.
[root@hrtask Downloads]# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/0.8.50
built by gcc 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC) 
TLS SNI support enabled
configure arguments: --user=root --group=root --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_addition_module --with-openssl=/root/Downloads/openssl-1.0.1c --with-pcre=/root/Downloads/pcre-8.20 --with-zlib=/root/Downloads/zlib-1.2.3 

컴 파일 설치 가 사용 되 었 음 을 알 수 있 습 니 다.
--user=root --group=root --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_addition_module --with-openssl=/root/Downloads/openssl-1.0.1c --with-pcre=/root/Downloads/pcre-8.20 --with-zlib=/root/Downloads/zlib-1.2.3

스 크 립 트 를 컴 파일 한 후 모듈 을 추가 해 야 합 니 다.
--add-module=/root/Downloads/echo-nginx-module-0.60

다음으로 변경:
./configure --user=root --group=root --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_addition_module --with-openssl=/root/Downloads/openssl-1.0.1c --with-pcre=/root/Downloads/pcre-8.20 --with-zlib=/root/Downloads/zlib-1.2.3 --add-module=/root/Downloads/echo-nginx-module-0.60

재 컴 파일
#make

제발 make install 하지 마 세 요. 그렇지 않 으 면 정말 덮어 씁 니 다.
먼저 이전 nginx 바 이 너 리 파일 을 백업 한 다음 바 꿉 니 다.
nginx 서비스 가 시작 되면 종료 해 야 합 니 다. 그렇지 않 으 면 nginx 복사 가 잘못 되 었 습 니 다.
# cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
# cp ./objs/nginx /usr/local/nginx/sbin/

해결 ~

좋은 웹페이지 즐겨찾기