ubuntu16.04 source compiler installation nginx1.14.2

1. Download nginx-1.14.2, the official website address: nginx.org

2, extract nginx-1.14.2.tar.gz   

      

tar zxvf  nginx-1.14.2.tar.gz

3, cut to the file folder nginx-1.14.2 

4、

With the configure script to compile the source code,. / Configure, use the default configuration. You may be prompted pcre, zlib library needs to rely on is installed, continue with the installation dependent pcre, zlib library,
carried out
sudo apt-get update    
sudo apt-get install libpcre3 libpcre3-dev  
apt-get install zlib1g-dev

Install gcc

sudo apt-get  install  build-essential

After installing continues

./configure

Results of the

5, run make and make install

6, to cut the path: / usr / local / nginx / sbin

     Excuting an order:

./nginx

7, to see if success

8, configuration software links

sudo ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx
nginx - S reload: reload configuration changes take effect after the 
nginx - S Reopen: reopens the log file 
nginx -t -c / path / to / nginx.conf test nginx configuration file is correct 

to close nginx: 
nginx - S STOP: Quick stop nginx 
         quit: a complete and orderly stop nginx 

other way of stopping nginx: 

PS -ef | grep nginx 

the kill - the qUIT main process ID: calm stop Nginx
 the kill - TERM main process ID: quick stop Nginx 
pkill - 9 nginx: forced stop Nginx 



start nginx : 
nginx -c / path / to / nginx.conf 

graceful restart nginx: 
the kill - HUP main process ID
 

 

Guess you like

Origin www.cnblogs.com/xwgcxk/p/10973645.html