>  기사  >  운영 및 유지보수  >  nginx 컴파일 및 설치 후 nginx를 원활하게 업그레이드하는 방법

nginx 컴파일 및 설치 후 nginx를 원활하게 업그레이드하는 방법

王林
王林앞으로
2023-05-13 20:25:111262검색

1. nginx

nginx 컴파일 및 설치 후 nginx를 원활하게 업그레이드하는 방법

다운로드 페이지:

wget -c http://nginx.org/download/nginx-1.13.12.tar.gz

2. nginx

이전 버전의 구성을 확인하세요: /usr/local/ nginx/sbin/nginx - v /usr/local/nginx/sbin/nginx -v

查看当前配置: /usr/local/nginx/sbin/nginx -v

현재 구성 보기: /usr/local/nginx/sbin/nginx -v

[root@zixuephp nginx-1.13.6]# /usr/local/nginx/sbin/nginx -v
nginx version: nginx/1.13.6
[root@zixuephp nginx-1.13.6]# /usr/local/nginx/sbin/nginx -v
nginx version: nginx/1.13.6
built by gcc 4.8.5 20150623 (red hat 4.8.5-16) (gcc) 
built with openssl 1.0.2k-fips 26 jan 2017
tls sni support enabled
configure arguments: --prefix=/usr/local/nginx --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_v2_module --with-http_gzip_static_module --with-http_sub_module --with-pcre --with-http_ssl_module
3 nginx 소스의 새 버전을 압축 해제합니다. 코드 패키지

tar -xzvf nginx-1.13.12.tar.gz
cd nginx-1.13.12
4. 재컴파일 전 새 버전 구성 비교

여기 구성은 이전 버전과 동일합니다: /usr/local/nginx/sbin/nginx -v

코드 복사 코드는 다음과 같습니다. 다음과 같습니다:

./configure --prefix=/usr/local/ nginx --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_v2_module -- with-http_gzip_static_module --with-http_sub_module --with-pcre --with- http_ssl_module

5. objs 디렉터리를 컴파일하고 생성하고 디렉터리에 들어가서 nginx

make

교체하면 objs가 있는 것을 볼 수 있습니다. ls를 통해 디렉토리

[root@zixuephp nginx-1.13.12]# ls
auto changes changes.ru conf configure contrib html license makefile man objs readme src
[root@zixuephp nginx-1.13.12]#

objs 디렉토리로 들어가 이전 버전의 nginx 메인 프로그램을 교체하세요(여기서 조작하세요 오류 방지를 위해 업그레이드하기 전에 꼭 백업해주세요)

[root@zixuephp objs]#mv nginx /usr/local/nginx/sbin/nginx
6. 원활한 업그레이드

make upgrade
7. 성공적으로 업그레이드되었습니다. 버전을 확인하세요.

[root@zixuephp nginx-1.13.12]# /usr/local/nginx/sbin/nginx -v
nginx version: nginx/1.13.12
[root@zixuephp nginx-1.13.12]# /usr/local/nginx/sbin/nginx -v
nginx version: nginx/1.13.12
built by gcc 4.8.5 20150623 (red hat 4.8.5-16) (gcc) 
built with openssl 1.0.2k-fips 26 jan 2017
tls sni support enabled
configure arguments: --prefix=/usr/local/nginx --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_v2_module --with-http_gzip_static_module --with-http_sub_module --with-pcre --with-http_ssl_module

문제가 발생하지 않도록 업그레이드하기 전에 nginx 프로그램과 웹사이트 파일을 미리 백업하세요. 🎜

위 내용은 nginx 컴파일 및 설치 후 nginx를 원활하게 업그레이드하는 방법의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
이 기사는 yisu.com에서 복제됩니다. 침해가 있는 경우 admin@php.cn으로 문의하시기 바랍니다. 삭제