Nginx新版本安装
提示:nginx版本必须安装openresty-1.11以上版本
1.1 yum所依赖的包 无法yum参考yum源设置及镜像挂载
yum -y install readline-devel pcre-devel openssl-devel gcc
无外网环境下载对应版本对应的包网址:
https://pkgs.org/download/pcre-devel
1.2 导入OpenResty.tar包
mkdir /home/bosssoft/nginx
tar -zxvf openresty-1.15.8.2.tar
Cd openresty-1.15.8.2
./configure
Make
Make install
1.3制作https证书(先暂时不执行这一步)
mkdir -p /usr/local/openresty/nginx/cert
cd /usr/local/openresty/nginx/cert
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
————————————————
1.4 修改配置
Cd /usr/local/openresty/nginx
替换conf包,更改nginx.conf中端口号
Cd /usr/local/openresty/nginx/conf/common
更改upstream.conf 文件,写入服务器的ip:端口
1.5启动
Cd /usr/local/openresty/nginx/sbin
./nginx
Ps -ef |grep nginx
网上参考文档
https://blog.csdn.net/chuishuwu3807/article/details/100893800