[Nginx] 컴 파일 설치 후 nginx 에 모듈 추가

1.1 전체적인 사고 설명
##     
01:    nginx          , nginx -V
02:   Nginx     nginx   ,          ;

##     
01:       nginx    ,             ;
02:./configure    (                  )
03:make,  make install
04: “03  ”     ,  path/objs/     nginx  

##     
01:  path/objs/nginx          nginx  
02:  nginx -V              
03:        /    nginx     

1.2 나의 현재 nginx 상태
#### nginx     
[root@node21 ~]# lsof -i :80
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
nginx   4774 root    6u  IPv4  27135      0t0  TCP *:http (LISTEN)
nginx   4788  www    6u  IPv4  27135      0t0  TCP *:http (LISTEN)

##### nginx        
[root@node21 ~]# which nginx
/data/apps/nginx/sbin/nginx

##### nginx          
[root@node21 ~]# nginx -V
nginx version: nginx/1.18.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) 
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/data/apps/nginx-1.18.0 --user=www --group=www --with-stream --with-http_ssl_module

1.3 nginx 모듈 추가 실천
여기에 하 나 를 추가 합 니 다 -- with - httpstub_status_모듈 모듈
####     :
	#     nginx          , nginx -V
	[root@node21 ~]# nginx -V
	nginx version: nginx/1.18.0
	built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) 
	built with OpenSSL 1.0.2k-fips  26 Jan 2017
	TLS SNI support enabled
	configure arguments: --prefix=/data/apps/nginx-1.18.0 --user=www --group=www --with-stream --with-http_ssl_module
	^==       --with-http_stub_status_module    
	
	#    Nginx     nginx   ;
	[root@node21 ~]# which nginx
    /data/apps/nginx/sbin/nginx
    [root@node21 ~]#
	[root@node21 ~]# mv /data/apps/nginx/sbin/nginx /data/apps/nginx/sbin/nginx.bak
	[root@node21 ~]# ll /data/apps/nginx/sbin/nginx.bak 
	-rwxr-xr-x 1 www www 6883920 7    9 15:27 /data/apps/nginx/sbin/nginx.bak


####     
	#   /root/tools  
	[root@node21 ~]# mkdir /root/tools
	[root@node21 ~]# ls -ld /root/tools/
	drwxr-xr-x 2 root root 33 7    9 16:38 /root/tools/
	
	#    /root/tools  ,     (    nginx       ),    ,     make install
	[root@node21 ~]# cd /root/tools/
	[root@node21 tools]# rz                    #        , yum install -y lrzsz    
	[root@node21 tools]# ll nginx-1.18.0.tar.gz 
	-rw-r--r-- 1 root root 1039530 6   10 08:20 nginx-1.18.0.tar.gz
	[root@node21 tools]#
	[root@node21 tools]# tar xf nginx-1.18.0.tar.gz 
	[root@node21 tools]# cd nginx-1.18.0
	[root@node21 nginx-1.18.0]#
	[root@node21 nginx-1.18.0]# ./configure  --prefix=/data/apps/nginx-1.18.0 --user=www --group=www --with-stream --with-http_ssl_module  --with-http_stub_status_module
	[root@node21 nginx-1.18.0]#
	[root@node21 nginx-1.18.0]# make            #   make install 
    [root@node21 nginx-1.18.0]#
    [root@node21 nginx-1.18.0]# pwd             #       
	/root/tools/nginx-1.18.0
	[root@node21 nginx-1.18.0]# ll objs/nginx   #       objs      nginx  
    -rwxr-xr-x 1 root root 6932616 7    9 16:53 objs/nginx


####      nginx  ,        nginx  
	[root@node21 ~]# ll /root/tools/nginx-1.18.0/objs/nginx
	-rwxr-xr-x 1 root root 6932616 7    9 16:42 /root/tools/nginx-1.18.0/objs/nginx
	
	[root@node21 ~]# cp -a /root/tools/nginx-1.18.0/objs/nginx  /data/apps/nginx/sbin
	[root@node21 ~]# ll /data/apps/nginx/sbin/nginx
	-rwxr-xr-x 1 root root 6932616 7    9 16:46 /data/apps/nginx/sbin/nginx
 
	[root@node21 ~]# which nginx
	/data/apps/nginx/sbin/nginx
	[root@node21 ~]# 
	[root@node21 ~]# nginx -V
	nginx version: nginx/1.18.0
	built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) 
	built with OpenSSL 1.0.2k-fips  26 Jan 2017
	TLS SNI support enabled
	configure arguments: --prefix=/data/apps/nginx-1.18.0 --user=www --group=www --with-stream --with-http_ssl_module --with-http_stub_status_module
	  ^==    --with-http_stub_status_module     


	[root@node21 ~]# chown www:www /data/apps/nginx/sbin/nginx
	[root@node21 ~]# ll /data/apps/nginx/sbin/nginx
	-rwxr-xr-x 1 www www 6932616 7    9 16:53 /data/apps/nginx/sbin/nginx

좋은 웹페이지 즐겨찾기