安裝 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發佈於博客園

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章