是的 ,这里都可以帮助你。。。
cd /usr/local/src
wget http://nginx.org/download/nginx-1.14.2.tar.gz
wget http://nginx.org/download/nginx-1.10.3.tar.gz
wget https://www.zlib.net/fossils/zlib-1.2.8.tar.gz
wget https://openssl.org/source/openssl-1.0.2d.tar.gz
wget https://github.com/simplresty/ngx_devel_kit/archive/v0.3.0.tar.gz -O ngx_devel_kit.tar.gz
wget https://github.com/jemalloc/jemalloc/releases/download/4.5.0/jemalloc-4.5.0.tar.bz2
wget https://github.com/yaoweibin/nginx_upstream_check_module/archive/v0.3.0.tar.gz -O nginx_upstream_check_module.tar.gz
wget https://github.com/openresty/lua-nginx-module/archive/v0.10.10.tar.gz -O lua-nginx-module.tar.gz
tar xf jemalloc-4.5.0.tar.bz2cd jemalloc-4.5.0 && ./configure && make && make install
apt-get install -y lua5.1-0-dev# apt-get install -y libjemalloc-dev 如果上面没有编译安装jemalloc,可以使用apt进行安装groupadd www
useradd www
tar xf nginx-1.10.3.tar.gz && cd nginx-1.10.3./configure --prefix=/webserver/nginx --user=www --group=www --with-pcre --with-zlib=/usr/local/src/zlib-1.2.8 --with-openssl=/usr/local/src/openssl-1.0.2d --with-http_gzip_static_module --with-http_realip_module --with-http_stub_status_module --add-module=/usr/local/src/ngx_devel_kit --add-module=/usr/local/src/lua-nginx-module --with-ld-opt=-ljemalloc --with-stream --with-http_ssl_module --add-module=/usr/local/src/nginx_upstream_check_module && make && make install
tar xf nginx-1.14.2.tar.gz && cd nginx-1.14.2./configure --prefix=/webserver/nginx14 --user=www --group=www --with-pcre --with-zlib=/usr/local/src/zlib-1.2.8 --with-openssl=/usr/local/src/openssl-1.0.2d --with-http_gzip_static_module --with-http_realip_module --with-http_stub_status_module --add-module=/usr/local/src/ngx_devel_kit --add-module=/usr/local/src/lua-nginx-module --with-ld-opt=-ljemalloc --with-stream --with-http_ssl_module --add-module=/usr/local/src/nginx_upstream_check_module && make && make install
> root@cluster-node1:/webserver/nginx/sbin# lsnginx
> root@cluster-node1:/webserver/nginx/sbin# pwd/webserver/nginx/sbin
> root@cluster-node1:/webserver/nginx/sbin# ./nginx> root@cluster-node1:/webserver/nginx/sbin# ps -ef |grep nginxroot 44682 1 0 11:27 ? 00:00:00 nginx: master process ./nginx
www 44683 44682 0 11:27 ? 00:00:00 nginx: worker process
root 44685 6939 0 11:27 pts/1 00:00:00 grep --color=auto nginx
> root@cluster-node1:/webserver/nginx/sbin# netstat -tunlp |grep nginxtcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 44682/nginx
> root@cluster-node1:/webserver/nginx/sbin# ./nginx -vnginx version: nginx/1.10.3> root@cluster-node1:/webserver/nginx/sbin# ./nginx -Vnginx version: nginx/1.10.3built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11)
built with OpenSSL 1.0.2d 9 Jul 2015TLS SNI support enabled
configure arguments: --prefix=/webserver/nginx --user=www --group=www --with-pcre --with-zlib=/usr/local/src/zlib-1.2.8 --with-openssl=/usr/local/src/openssl-1.0.2d --with-http_gzip_static_module --with-http_realip_module --with-http_stub_status_module --add-module=/usr/local/src/ngx_devel_kit --add-module=/usr/local/src/lua-nginx-module --with-ld-opt=-ljemalloc --with-stream --with-http_ssl_module --add-module=/usr/local/src/nginx_upstream_check_module
> root@cluster-node1:/webserver/nginx/sbin# curl -I http://localhostHTTP/1.1 200 OK
Server: nginx/1.10.3Date: Thu, 01 Aug 2019 15:29:08 GMT
Content-Type: text/html
Content-Length: 612Last-Modified: Thu, 01 Aug 2019 15:12:52 GMT
Connection: keep-alive
ETag: "5d430174-264"Accept-Ranges: bytes
root@cluster-node1:/webserver/nginx/sbin# cp ./nginx ./nginx_1.10.3root@cluster-node1:/webserver/nginx/sbin# ls -ltotal 24840-rwxr-xr-x 1 root root 12715840 Aug 1 11:12 nginx
-rwxr-xr-x 1 root root 12715840 Aug 1 11:30 nginx_1.10.3
root@cluster-node1:/webserver/nginx/sbin# cp -f /webserver/nginx14/sbin/nginx ./root@cluster-node1:/webserver/nginx/sbin# ls -ltotal 25680-rwxr-xr-x 1 root root 13574704 Aug 1 11:31 nginx
-rwxr-xr-x 1 root root 12715840 Aug 1 11:30 nginx_1.10.3
root@cluster-node1:/webserver/nginx/sbin# ps -ef | grep nginxroot 44682 1 0 11:27 ? 00:00:00 nginx: master process ./nginx
www 44683 44682 0 11:27 ? 00:00:00 nginx: worker process
root 44709 6939 0 11:33 pts/1 00:00:00 grep --color=auto nginx
root@cluster-node1:/webserver/nginx/sbin# kill -USR2 44682root@cluster-node1:/webserver/nginx/sbin# ps -ef | grep nginxroot 44682 1 0 11:27 ? 00:00:00 nginx: master process ./nginx
www 44683 44682 0 11:27 ? 00:00:00 nginx: worker process
root 44710 44682 0 11:34 ? 00:00:00 nginx: master process ./nginx
www 44711 44710 0 11:34 ? 00:00:00 nginx: worker process
root 44713 6939 0 11:34 pts/1 00:00:00 grep --color=auto nginx
root@cluster-node1:/webserver/nginx/sbin# curl -I http://localhostHTTP/1.1 200 OK
Server: nginx/1.14.2Date: Thu, 01 Aug 2019 15:34:41 GMT
Content-Type: text/html
Content-Length: 612Last-Modified: Thu, 01 Aug 2019 15:25:32 GMT
Connection: keep-alive
ETag: "5d43046c-264"Accept-Ranges: bytes
root@cluster-node1:/webserver/nginx/sbin# kill -WINCH 44682root@cluster-node1:/webserver/nginx/sbin# ps -ef | grep nginxroot 44682 1 0 11:27 ? 00:00:00 nginx: master process ./nginx
root 44710 44682 0 11:34 ? 00:00:00 nginx: master process ./nginx
www 44711 44710 0 11:34 ? 00:00:00 nginx: worker process
root 44757 6939 0 11:36 pts/1 00:00:00 grep --color=auto nginx
root@cluster-node1:/webserver/nginx/sbin# ./nginx -vnginx version: nginx/1.14.2root@cluster-node1:/webserver/nginx/sbin# ./nginx -Vnginx version: nginx/1.14.2built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11)
built with OpenSSL 1.0.2d 9 Jul 2015TLS SNI support enabled
configure arguments: --prefix=/webserver/nginx14 --user=www --group=www --with-pcre --with-zlib=/usr/local/src/zlib-1.2.8 --with-openssl=/usr/local/src/openssl-1.0.2d --with-http_gzip_static_module --with-http_realip_module --with-http_stub_status_module --add-module=/usr/local/src/ngx_devel_kit --add-module=/usr/local/src/lua-nginx-module --with-ld-opt=-ljemalloc --with-stream --with-http_ssl_module --add-module=/usr/local/src/nginx_upstream_check_module
root@cluster-node1:/webserver/nginx/sbin# ./nginx -s quitroot@cluster-node1:/webserver/nginx/sbin# ps -ef |grep nginxroot 44682 1 0 11:27 ? 00:00:00 nginx: master process ./nginx
www 44783 44682 0 11:38 ? 00:00:00 nginx: worker process
root 44785 6939 0 11:38 pts/1 00:00:00 grep --color=auto nginx
root@cluster-node1:/webserver/nginx/sbin# ./nginx -vnginx version: nginx/1.14.2root@cluster-node1:/webserver/nginx/sbin# ps -ef |grep nginxroot 44682 1 0 11:27 ? 00:00:00 nginx: master process ./nginx
www 44783 44682 0 11:38 ? 00:00:00 nginx: worker process
root 44788 6939 0 11:38 pts/1 00:00:00 grep --color=auto nginx
root@cluster-node1:/webserver/nginx/sbin# ./nginx -s reloadnginx: [error] open() "/webserver/nginx14/logs/nginx.pid" failed (2: No such file or directory)
root@cluster-node1:/webserver/nginx/sbin# ./nginxnginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
root@cluster-node1:/webserver/nginx/sbin# ./nginx -s stopnginx: [error] open() "/webserver/nginx14/logs/nginx.pid" failed (2: No such file or directory)
root@cluster-node1:/webserver/nginx/sbin# ls -l /webserver/nginx14/logs/nginx.pidls: cannot access '/webserver/nginx14/logs/nginx.pid': No such file or directory
root@cluster-node1:/webserver/nginx/sbin# pkill nginxroot@cluster-node1:/webserver/nginx/sbin# ./nginxroot@cluster-node1:/webserver/nginx/sbin# ps -ef |grep nginxroot 44800 1 0 11:39 ? 00:00:00 nginx: master process ./nginx
www 44801 44800 0 11:39 ? 00:00:00 nginx: worker process
root 44803 6939 0 11:40 pts/1 00:00:00 grep --color=auto nginx
root@cluster-node1:/webserver/nginx/sbin# ./nginx -vnginx version: nginx/1.14.2