安装 nginx-yum

Operating System: Alibaba Cloud Linux 3 (Soaring Falcon)

nginx-1.24.0-1.el7.ngx.x86_64.rpm

nginx 1.20.1

---

 

序章

http://nginx.org

2024-02-27    
unit-1.32.0 version has been released, featuring the WebAssembly Component Model and Unit variables access from njs.

2024-02-14    
nginx-1.25.4 mainline version has been released, with fixes for vulnerabilities in HTTP/3 (CVE-2024-24989, CVE-2024-24990).

2024-02-07    
njs-0.8.3 version has been released.

 

注意,安装全程使用 root 账号。

 

安装1:RPM包-失败

根据 参考资料#1 ,找到 nginx-1.24.0-1.el7.ngx.x86_64.rpm,wget 到本地。

# wget https://nginx.org/packages/centos/7/x86_64/RPMS/nginx-1.24.0-1.el7.ngx.x86_64.rpm

使用 rpm 执行安装:

# rpm -ivh nginx-1.24.0-1.el7.ngx.x86_64.rpm
warning: nginx-1.24.0-1.el7.ngx.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 7bd9bf62: NOKEY
error: Failed dependencies:
        libcrypto.so.10()(64bit) is needed by nginx-1:1.24.0-1.el7.ngx.x86_64
        libcrypto.so.10(OPENSSL_1.0.2)(64bit) is needed by nginx-1:1.24.0-1.el7.ngx.x86_64
        libcrypto.so.10(libcrypto.so.10)(64bit) is needed by nginx-1:1.24.0-1.el7.ngx.x86_64
        libssl.so.10()(64bit) is needed by nginx-1:1.24.0-1.el7.ngx.x86_64
        libssl.so.10(libssl.so.10)(64bit) is needed by nginx-1:1.24.0-1.el7.ngx.x86_64
[root@xxx nginx]#

 

该 RPM 包 要求的是 OPENSSL_1.0.2,而自己的系统中,OPENSSL 的版本 较高,为 1.1.1k:

# rpm -qa | grep openssl
openssl-libs-1.1.1k-9.0.1.al8.x86_64
openssl-1.1.1k-9.0.1.al8.x86_64
openssl-pkcs11-0.4.10-3.0.1.al8.x86_64

 

附:Welcome to OpenSSL!
The OpenSSL Project develops and maintains the OpenSSL software - a robust, commercial-grade, full-featured toolkit for general-purpose cryptography and secure communication. The project’s technical decision making is managed by the OpenSSL Technical Committee (OTC) and the project governance is managed by the OpenSSL Management Committee (OMC). The project operates under formal Bylaws.
https://www.openssl.org

 

安装未成功,放弃这种方式。

 

安装2:yum-成功

yum 查询 nginx:

# yum search nginx
Last metadata expiration check: 0:00:23 ago on Mon 18 Mar 2024 10:01:02 AM CST.
================================================================================ Name Exactly Matched: nginx ================================================================================
nginx.x86_64 : A high performance web server and reverse proxy server
=============================================================================== Name & Summary Matched: nginx ===============================================================================
aa_nginx.x86_64 : Anolis accelerated NGINX*
aa_nginx-doc.noarch : Documentation files for aa_nginx
asynch_mode_nginx.x86_64 : Asynch Mode for NGINX*
asynch_mode_nginx-doc.noarch : Documentation files for asynch_mode_nginx
collectd-nginx.x86_64 : Nginx plugin for collectd
lemonldap-ng-nginx.noarch : LemonLDAP-NG Nginx support

找到 nginx.x86_64

 

查看 nginx 的信息:版本 1.20.1

# yum info nginx
Last metadata expiration check: 3:08:37 ago on Mon 18 Mar 2024 10:01:02 AM CST.
Installed Packages
Name         : nginx
Epoch        : 1
Version      : 1.20.1
Release      : 1.0.3.al8
Architecture : x86_64
Size         : 1.9 M
Source       : nginx-1.20.1-1.0.3.al8.src.rpm

more

 

安装 yum:

yum install nginx.x86_64

 

查看安装后的状态:

# systemctl status nginx
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: inactive (dead)

 

启动 nginx:

# systemctl start nginx.service

注,停止使用 stop。

 

启动后检查状态:running

在上图 Loaded 开头的行,出现了两个 enabled,表示 nginx 是自启动的。

通义千问 回答:

--

 

访问 该 nginx(80端口):

 

其它

nginx 安全漏洞

在 nginx 的 nginx security advisories 页,可以看到一些安全相关的信息:

https://nginx.org/en/security_advisories.html

--

生产环境使用时,请 注意 采取措施修复漏洞——有时候会被要求强制修补漏洞。

 

ben发布于博客园

---END---

ben发布于博客园

本文链接:

https://www.cnblogs.com/luo630/p/18080185

ben发布于博客园

参考资料

1、centos7 rpm安装nginx
https://www.cnblogs.com/sky-cheng/p/14621145.html

2、升级openssl后nginx无法编译安装问题之解决方法
乐渔leyu
于 2019-10-22 17:05:55 发布
原文链接:
https://blog.csdn.net/my1114/article/details/102686418

3、如何使用`systemctl status`命令来查看服务状态?
举报 wljslmz 发表于 2023/06/20 22:56:30
https://bbs.huaweicloud.com/blogs/402430

4、

 

ben发布于博客园

ben发布于博客园

 

posted @ 2024-03-18 21:00  快乐的欧阳天美1114  阅读(192)  评论(0编辑  收藏  举报