nginx 常用命令及升级到1.20.1版本

nginx 常用命令

免密证书输入

openssl rsa -in server.key -out server.key.unsecure

openssl req -new -x509 -nodes -out server.crt -keyout server.key

启动

./nginx

systemctl start nginx

service nginx start

优雅重启

./nginx -s reload

检查配置

nginx -t

Nginx服务器指定启动配置文件命令

./nginx -c /usr/local/nginx1.20/conf/nginx.conf

升级1.20.1教程

(78条消息) Nginx 升级到 nginx-1.20.1_lq9616的博客-CSDN博客_nginx最新版本

遇到报错1:

Failed to start nginx - high performance web server.

image-20220721135919016

解决办法先备份文件,重新加载nginx再复制回去:

mv nginx nginx.bak2

systemctl nginx restart

cp -r nginx.bak nginx

systemctl nginx restart

最后一步

mv /usr/sbin/nginx /usr/sbin/nginx.old
cp /usr/local/nginx1.20/sbin/nginx /usr/sbin/nginx
cd /usr/sbin/
./nginx -t
./nginx.old -s stop
./nginx
ps -ef|grep nginx

猜你喜欢

转载自blog.csdn.net/qq_58432443/article/details/125940162