Nginx 1.14.0 安装步骤

1、创建分组

sudo groupadd nginx

2、创建用户以目录空间

sudo useradd nginx -g nginx -d /app/xsbank/nginx

3、准备Nginx相关安装包

nginx-1.14.0.tar.gz 、 openssl-1.0.1t.tar.gz 、 pcre-8.39.tar.gz 、zlib-1.2.11.tar.gz

4、把相关安装包上传至如下服务器

服务器路径为/app/xsbank/nginx/software

5、登录上述各服务器,开始安装PCRE库

tar -zxvf pcre-8.39.tar.gz

cd pcre-8.39

./configure

make

make install

6、安装zlib库

tar -zxvf zlib-1.2.11.tar.gz

cd /app/appopt/zlib-1.2.11

./configure

make

make install

7、安装openssl

tar -zxvf openssl-1.0.1t.tar.gz

cd /app/appopt/openssl-1.0.1t

./config

make

make install

8、安装nginx

tar -zxvf nginx-1.14.0.tar.gz

cd /app/appopt/nginx-1.14.0

#可以指定安装目录

./configure --prefix=/app/appopt/nginx-1.14.0 --with-http_stub_status_module --with-http_ssl_module --with-file-aio --with-http_realip_module --with-stream

make && make install

9、启动nginx

cd /app/appopt/nginx-1.14.0/sbin

./nginx -c conf/nginx.conf

检查nginx.conf配置

./nginx -t

重启nginx

./nginx -s reload

停止nginx

./nginx -s stop

posted @ 2020-04-29 08:40  持续成长  阅读(776)  评论(0编辑  收藏  举报