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

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)

相关文章:

  • 酒水速送小程序开发制作方案
  • 传奇架设教程:传奇登录器公告窗口如何设置?link.htm网页文件制作教程
  • TPAMI 2024 | 数据不平衡克星,ProCo算法:长尾视觉识别的终极解决方案!
  • Django中媒体文件的配置
  • **CentOS7安装Maven**
  • 20 基于STM32的温度、电流、电压检测proteus仿真系统(OLED、DHT11、继电器、电机)
  • 常用性能优化方法
  • 使用Jlink打印单片机的调试信息
  • 数据结构编程实践20讲(Python版)—04队列
  • Django 常用注解
  • slam入门学习笔记
  • 某系统超级管理员密码重置通用型
  • ECMAScript与JavaScript的区别:深入解析
  • Virtio半虚拟化基本原理简介
  • 有关在.Net Core中以TEXT类型将Json格式字段存到数据库的学习
  • 「译」Node.js Streams 基础
  • 【399天】跃迁之路——程序员高效学习方法论探索系列(实验阶段156-2018.03.11)...
  • 【407天】跃迁之路——程序员高效学习方法论探索系列(实验阶段164-2018.03.19)...
  • Netty+SpringBoot+FastDFS+Html5实现聊天App(六)
  • RxJS: 简单入门
  • spring boot下thymeleaf全局静态变量配置
  • Three.js 再探 - 写一个跳一跳极简版游戏
  • 发布国内首个无服务器容器服务,运维效率从未如此高效
  • 关于extract.autodesk.io的一些说明
  • 实战:基于Spring Boot快速开发RESTful风格API接口
  • 正则学习笔记
  • 终端用户监控:真实用户监控还是模拟监控?
  • Salesforce和SAP Netweaver里数据库表的元数据设计
  • 交换综合实验一
  • 浅谈sql中的in与not in,exists与not exists的区别
  • 曾刷新两项世界纪录,腾讯优图人脸检测算法 DSFD 正式开源 ...
  • ​ ​Redis(五)主从复制:主从模式介绍、配置、拓扑(一主一从结构、一主多从结构、树形主从结构)、原理(复制过程、​​​​​​​数据同步psync)、总结
  • ​​​【收录 Hello 算法】10.4 哈希优化策略
  • ​必胜客礼品卡回收多少钱,回收平台哪家好
  • #define 用法
  • #LLM入门|Prompt#1.8_聊天机器人_Chatbot
  • (01)ORB-SLAM2源码无死角解析-(56) 闭环线程→计算Sim3:理论推导(1)求解s,t
  • (2)leetcode 234.回文链表 141.环形链表
  • (2021|NIPS,扩散,无条件分数估计,条件分数估计)无分类器引导扩散
  • (3)选择元素——(17)练习(Exercises)
  • (32位汇编 五)mov/add/sub/and/or/xor/not
  • (51单片机)第五章-A/D和D/A工作原理-A/D
  • (c语言版)滑动窗口 给定一个字符串,只包含字母和数字,按要求找出字符串中的最长(连续)子串的长度
  • (webRTC、RecordRTC):navigator.mediaDevices undefined
  • (zz)子曾经曰过:先有司,赦小过,举贤才
  • (定时器/计数器)中断系统(详解与使用)
  • (附源码)spring boot基于小程序酒店疫情系统 毕业设计 091931
  • (附源码)springboot美食分享系统 毕业设计 612231
  • (附源码)springboot学生选课系统 毕业设计 612555
  • (附源码)ssm基于jsp高校选课系统 毕业设计 291627
  • ***微信公众号支付+微信H5支付+微信扫码支付+小程序支付+APP微信支付解决方案总结...
  • *Django中的Ajax 纯js的书写样式1
  • .NET 3.0 Framework已经被添加到WindowUpdate
  • .NET MAUI学习笔记——2.构建第一个程序_初级篇
  • .Net Memory Profiler的使用举例