当前位置: 首页 > article >正文

centos7 yum 更新 nginx 到最新版本 1.26

centos7 yum 更新 nginx 到最新版本 1.26

参考:
centos7中把nginx更新到1.26 版(centos7默认只能更新到1.20)
https://blog.csdn.net/weilaozongge/article/details/138862749

nginx报错 Can‘t open PID file /var/run/nginx.pid (yet?) after start: No such file or directory
https://blog.csdn.net/weixin_71343552/article/details/142100981

Centos7下yum安装nginx本地仓库无nginx源解决方案
https://blog.csdn.net/weixin_61367575/article/details/137998088
nginx位于第三方的yum源里面,而不在centos官方yum源里面
yum源安装epel
由于Nginx在非官方yum源。提供了两种方法:一是通过下载epel源并配置国内镜像;
二是直接安装epel并更新后安装Nginx。强调了安装后的验证步骤。

sudo yum install epel-release

sudo yum install nginx

sudo systemctl status nginx

sudo systemctl start nginx

sudo systemctl enable nginx

sudo yum install yum-utils

sudo vi /etc/yum.repos.d/nginx.repo

[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

sudo yum-config-manager --enable nginx-stable

sudo yum update nginx

Can’t open PID file /var/run/nginx.pid (yet?) after start: No such file or directory

sudo vi /etc/systemd/system/nginx.service.d/override.conf

[Service]
ExecStartPost=/bin/sleep 0.1

sudo systemctl daemon-reload

sudo systemctl status nginx

sudo systemctl restart nginx ---- 重启之前应该问一下,是否能够重启,别影响别人的业务

下面是分析,用上面的就行

在CentOS7.9上 编译安装openssl-3.3.1+编译安装Nginx1.26.2 - Magiclala - 博客园 (cnblogs.com)

Index of /packages/centos/9/x86_64/RPMS/ (nginx.org)

nginx: Linux packages

nginx: download

nginx -V

nginx version: nginx/1.26.1
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx
–sbin-path=/usr/sbin/nginx
–modules-path=/usr/lib64/nginx/modules
–conf-path=/etc/nginx/nginx.conf
–error-log-path=/var/log/nginx/error.log
–http-log-path=/var/log/nginx/access.log
–pid-path=/var/run/nginx.pid
–lock-path=/var/run/nginx.lock
–http-client-body-temp-path=/var/cache/nginx/client_temp
–http-proxy-temp-path=/var/cache/nginx/proxy_temp
–http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp
–http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp
–http-scgi-temp-path=/var/cache/nginx/scgi_temp
–user=nginx
–group=nginx
–with-compat
–with-file-aio
–with-threads
–with-http_addition_module
–with-http_auth_request_module
–with-http_dav_module
–with-http_flv_module
–with-http_gunzip_module
–with-http_gzip_static_module
–with-http_mp4_module
–with-http_random_index_module
–with-http_realip_module
–with-http_secure_link_module
–with-http_slice_module
–with-http_ssl_module
–with-http_stub_status_module
–with-http_sub_module
–with-http_v2_module
–with-mail
–with-mail_ssl_module
–with-stream
–with-stream_realip_module
–with-stream_ssl_module
–with-stream_ssl_preread_module
–with-cc-opt=‘-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC’
–with-ld-opt=‘-Wl,-z,relro -Wl,-z,now -pie’

grep nginx /etc/passwd

nginx:x:997:995:Nginx web server:/var/lib/nginx:/sbin/nologin

cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)


http://www.kler.cn/a/322383.html

相关文章:

  • 编译OpenCV的速度,家里和公司的电脑相差很大
  • 笔记02----重新思考轻量化视觉Transformer中的局部感知CloFormer(即插即用)
  • 详细解读CNAS实验室认证
  • Excel——宏教程(2)
  • 【鸿蒙生态崛起,开发者有哪些机遇与挑战?】HarmonyOS NEXT 引领数字化未来
  • 集群聊天服务器(13)redis环境安装和发布订阅命令
  • 【Kotlin 集合概述】可变参数vararg、中缀函数infix以及解构声明(二十)
  • MySQL record 07 part
  • 自动化办公-Python-os模块的使用
  • 标准 I/O
  • 西门子6ES7414-4HM14-0AB0 CPU模块的优缺点
  • 最佳植树距离 - 华为OD统一考试(E卷)
  • 记录Mac编译Android源码踩过的坑
  • offset、client 和 scroll【JavaScript】
  • 这些主流的财务管理软件,你用过哪款?
  • 计算机网络中的VLAN详解
  • ASCII Unicode UTF-8 字符集 字符编码
  • 喜报丨INDEMIND荣获第九届“创客中国”智能机器人中小企业创新创业大赛三等奖
  • 【HTTP 和 HTTPS详解】1
  • 如何快速熟悉项目
  • Facebook公共主页bug问题解决措施清单
  • TDOA方法求二维坐标的MATLAB代码演示与讲解
  • 在ubuntu24.04上安装Ollama并设置跨域访问
  • 动态规划算法:10.路径问题_地下城游戏_C++
  • GPS定位和测量原理
  • 8,STM32CubeMX配置SPI工程(读取norflash的ID)