首页 > 系统相关 >45 openEuler搭建Nginx服务器-Nginx概述和安装

45 openEuler搭建Nginx服务器-Nginx概述和安装

时间:2023-04-04 20:38:33浏览次数:37  
标签:11 x86 nginx oe2203 45 Nginx 64 openEuler 1.21

45 openEuler搭建Nginx服务器-Nginx概述和安装

45.1 概述

Nginx 是一款轻量级的 Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,其特点是占用内存少,并发能力强,事实上nginx的并发能力在同类型的网页服务器中表现较好,支持FastCGI、SSL、Virtual Host、URL Rewrite、Gzip等功能,并且支持很多第三方的模块扩展。

Nginx (engine x) 是一个高性能的HTTP和反向代理web服务器 ,同时也提供了IMAP/POP3/SMTP服务。Nginx是由伊戈尔·赛索耶夫为俄罗斯访问量第二的Rambler.ru站点(俄文:Рамблер)开发的,公开版本1.19.6发布于2020年12月15日。

其将源代码以类BSD许可证的形式发布,因它的稳定性、丰富的功能集、简单的配置文件和低系统资源的消耗而闻名。2022年01月25日,nginx 1.21.6发布。

45.2 安装

  1. 配置本地yum源,详细信息请参考《openEuler 22.03-LTS 搭建repo服务器》。

  2. 清除缓存。

# dnf clean all

例如示例命令如下:

[root@superman-21 ~]# dnf clean all
36 files removed
[root@superman-21 ~]# 
  1. 创建缓存。
# dnf makecache

例如示例命令如下:

[root@superman-21 ~]# dnf makecache
OS                                                                                           6.8 MB/s | 3.4 MB     00:00    
everything                                                                                    19 MB/s |  16 MB     00:00    
EPOL                                                                                         3.9 MB/s | 2.6 MB     00:00    
debuginfo                                                                                    3.3 MB/s | 3.9 MB     00:01    
source                                                                                       1.1 MB/s | 1.7 MB     00:01    
update                                                                                        25 MB/s |  28 MB     00:01    
Metadata cache created.
[root@superman-21 ~]#
  1. 在root权限下安装nginx服务。
# dnf install nginx

例如示例命令如下:

[root@superman-21 ~]# dnf install nginx
Last metadata expiration check: 0:00:34 ago on 2022年12月03日 星期六 10时39分32秒.
Dependencies resolved.
=============================================================================================================================
 Package                                   Architecture         Version                           Repository            Size
=============================================================================================================================
Installing:
 nginx                                     x86_64               1:1.21.5-3.oe2203                 update               498 k
Installing dependencies:
 gd                                        x86_64               2.3.2-2.oe2203                    update               127 k
 libXpm                                    x86_64               3.5.13-1.oe2203                   OS                    41 k
 libwebp                                   x86_64               1.2.1-1.oe2203                    OS                   246 k
 nginx-all-modules                         noarch               1:1.21.5-3.oe2203                 update               7.6 k
 nginx-filesystem                          noarch               1:1.21.5-3.oe2203                 update               8.7 k
 nginx-mod-http-image-filter               x86_64               1:1.21.5-3.oe2203                 update                18 k
 nginx-mod-http-perl                       x86_64               1:1.21.5-3.oe2203                 update                27 k
 nginx-mod-http-xslt-filter                x86_64               1:1.21.5-3.oe2203                 update                17 k
 nginx-mod-mail                            x86_64               1:1.21.5-3.oe2203                 update                49 k
 nginx-mod-stream                          x86_64               1:1.21.5-3.oe2203                 update                71 k

Transaction Summary
=============================================================================================================================
Install  11 Packages

Total download size: 1.1 M
Installed size: 3.0 M
Is this ok [y/N]: y
Downloading Packages:
(1/11): libXpm-3.5.13-1.oe2203.x86_64.rpm                                                    248 kB/s |  41 kB     00:00    
(2/11): gd-2.3.2-2.oe2203.x86_64.rpm                                                         562 kB/s | 127 kB     00:00    
(3/11): nginx-all-modules-1.21.5-3.oe2203.noarch.rpm                                         168 kB/s | 7.6 kB     00:00    
(4/11): nginx-filesystem-1.21.5-3.oe2203.noarch.rpm                                          186 kB/s | 8.7 kB     00:00    
(5/11): nginx-mod-http-image-filter-1.21.5-3.oe2203.x86_64.rpm                               385 kB/s |  18 kB     00:00    
(6/11): libwebp-1.2.1-1.oe2203.x86_64.rpm                                                    611 kB/s | 246 kB     00:00    
(7/11): nginx-mod-http-perl-1.21.5-3.oe2203.x86_64.rpm                                       431 kB/s |  27 kB     00:00    
(8/11): nginx-mod-http-xslt-filter-1.21.5-3.oe2203.x86_64.rpm                                395 kB/s |  17 kB     00:00    
(9/11): nginx-mod-mail-1.21.5-3.oe2203.x86_64.rpm                                            816 kB/s |  49 kB     00:00    
(10/11): nginx-mod-stream-1.21.5-3.oe2203.x86_64.rpm                                         791 kB/s |  71 kB     00:00    
(11/11): nginx-1.21.5-3.oe2203.x86_64.rpm                                                    1.1 MB/s | 498 kB     00:00    
-----------------------------------------------------------------------------------------------------------------------------
Total                                                                                        1.7 MB/s | 1.1 MB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                     1/1 
  Running scriptlet: nginx-filesystem-1:1.21.5-3.oe2203.noarch                                                          1/11 
  Installing       : nginx-filesystem-1:1.21.5-3.oe2203.noarch                                                          1/11 
  Installing       : libwebp-1.2.1-1.oe2203.x86_64                                                                      2/11 
  Installing       : libXpm-3.5.13-1.oe2203.x86_64                                                                      3/11 
  Installing       : gd-2.3.2-2.oe2203.x86_64                                                                           4/11 
  Running scriptlet: gd-2.3.2-2.oe2203.x86_64                                                                           4/11 
  Installing       : nginx-mod-http-perl-1:1.21.5-3.oe2203.x86_64                                                       5/11 
  Running scriptlet: nginx-mod-http-perl-1:1.21.5-3.oe2203.x86_64                                                       5/11 
  Installing       : nginx-mod-http-xslt-filter-1:1.21.5-3.oe2203.x86_64                                                6/11 
  Running scriptlet: nginx-mod-http-xslt-filter-1:1.21.5-3.oe2203.x86_64                                                6/11 
  Installing       : nginx-mod-mail-1:1.21.5-3.oe2203.x86_64                                                            7/11 
  Running scriptlet: nginx-mod-mail-1:1.21.5-3.oe2203.x86_64                                                            7/11 
  Installing       : nginx-mod-stream-1:1.21.5-3.oe2203.x86_64                                                          8/11 
  Running scriptlet: nginx-mod-stream-1:1.21.5-3.oe2203.x86_64                                                          8/11 
  Installing       : nginx-1:1.21.5-3.oe2203.x86_64                                                                     9/11 
  Running scriptlet: nginx-1:1.21.5-3.oe2203.x86_64                                                                     9/11 
  Installing       : nginx-mod-http-image-filter-1:1.21.5-3.oe2203.x86_64                                              10/11 
  Running scriptlet: nginx-mod-http-image-filter-1:1.21.5-3.oe2203.x86_64                                              10/11 
  Installing       : nginx-all-modules-1:1.21.5-3.oe2203.noarch                                                        11/11 
  Running scriptlet: nginx-all-modules-1:1.21.5-3.oe2203.noarch                                                        11/11 
  Verifying        : libXpm-3.5.13-1.oe2203.x86_64                                                                      1/11 
  Verifying        : libwebp-1.2.1-1.oe2203.x86_64                                                                      2/11 
  Verifying        : gd-2.3.2-2.oe2203.x86_64                                                                           3/11 
  Verifying        : nginx-1:1.21.5-3.oe2203.x86_64                                                                     4/11 
  Verifying        : nginx-all-modules-1:1.21.5-3.oe2203.noarch                                                         5/11 
  Verifying        : nginx-filesystem-1:1.21.5-3.oe2203.noarch                                                          6/11 
  Verifying        : nginx-mod-http-image-filter-1:1.21.5-3.oe2203.x86_64                                               7/11 
  Verifying        : nginx-mod-http-perl-1:1.21.5-3.oe2203.x86_64                                                       8/11 
  Verifying        : nginx-mod-http-xslt-filter-1:1.21.5-3.oe2203.x86_64                                                9/11 
  Verifying        : nginx-mod-mail-1:1.21.5-3.oe2203.x86_64                                                           10/11 
  Verifying        : nginx-mod-stream-1:1.21.5-3.oe2203.x86_64                                                         11/11 

Installed:
  gd-2.3.2-2.oe2203.x86_64                                          libXpm-3.5.13-1.oe2203.x86_64                            
  libwebp-1.2.1-1.oe2203.x86_64                                     nginx-1:1.21.5-3.oe2203.x86_64                           
  nginx-all-modules-1:1.21.5-3.oe2203.noarch                        nginx-filesystem-1:1.21.5-3.oe2203.noarch                
  nginx-mod-http-image-filter-1:1.21.5-3.oe2203.x86_64              nginx-mod-http-perl-1:1.21.5-3.oe2203.x86_64             
  nginx-mod-http-xslt-filter-1:1.21.5-3.oe2203.x86_64               nginx-mod-mail-1:1.21.5-3.oe2203.x86_64                  
  nginx-mod-stream-1:1.21.5-3.oe2203.x86_64                        

Complete!
[root@superman-21 ~]# 
  1. 查看安装后的rpm包。
# dnf list all | grep nginx

例如示例命令如下:

[root@superman-21 ~]# dnf list all | grep nginx
nginx.x86_64                                            1:1.21.5-3.oe2203                            @update   
nginx-all-modules.noarch                                1:1.21.5-3.oe2203                            @update   
nginx-filesystem.noarch                                 1:1.21.5-3.oe2203                            @update   
nginx-mod-http-image-filter.x86_64                      1:1.21.5-3.oe2203                            @update   
nginx-mod-http-perl.x86_64                              1:1.21.5-3.oe2203                            @update   
nginx-mod-http-xslt-filter.x86_64                       1:1.21.5-3.oe2203                            @update   
nginx-mod-mail.x86_64                                   1:1.21.5-3.oe2203                            @update   
nginx-mod-stream.x86_64                                 1:1.21.5-3.oe2203                            @update   
nginx.src                                               1:1.21.5-1.oe2203                            source    
nginx-debuginfo.x86_64                                  1:1.21.5-3.oe2203                            update    
nginx-debugsource.x86_64                                1:1.21.5-3.oe2203                            update    
nginx-help.noarch                                       1:1.21.5-3.oe2203                            update    
pcp-pmda-nginx.x86_64                                   5.3.5-6.oe2203                               OS        
pcp-pmda-nginx.x86_64                                   5.3.5-6.oe2203                               everything
[root@superman-21 ~]# 

标签:11,x86,nginx,oe2203,45,Nginx,64,openEuler,1.21
From: https://blog.51cto.com/u_237826/6169490

相关文章

  • Nginx——Nginx生产环境压测与性能优化实战
    摘要nginx的主要作用有三个方面:1、作为Web服务器;2、负载均衡服务器;3、邮件代理服务器等三个方面。其特点是占有内存少,并发能力强,给使用者带来了很多的便利。nginx是一款轻量级的Web服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,在BSD-like协议下发行。但是在日常的工作......
  • nginx 配置小程序校验文件
    1、参考nginx配置小程序校验文件location/riAwbtUM3G.txt{default_typetext/html;return200"43191f769a41f4035dbc1e6d9d0cfa32";}......
  • 3-nginx
    2、正向代理和反向代理的区别是什么?正向代理是一个位于客户端和原始服务器之间的服务器,为了从原始服务器取得内容,客户端向代理发送一个请求并指定原始服务器,然后代理向原始服务器转交请求并将获得的内容返回给客户端。代理服务器和客户端处于同一个局域网内。比如说fanqiang。我......
  • 1345. 跳跃游戏 IV
    题目描述给一个数组arr,起点是0,终点是n-1有3种选择:可以退一步、进一步、跳到值相等的位置问跳到终点的最少操作次数?f1哈希表+bfs基本分析为什么是bfs?求从起点到终点的最短路图是什么?当前节点到前、后、等值可跳的索引怎么获取x到所有等值点索引y的映射关系?哈希表预处理......
  • COMP6451 Ethereum 编程
    UNSWCOMP6451Assignment2(version2)?EthereumProgramming(ERC-20TokenDutchAuctionMarket)TotalMarks:35DueDate:5pm,March31,2023(Distributiontothirdpartiesand/orplacementonnon-UNSWwebsitesprohibited.)BackgroundAvarietyofschemesareuse......
  • nginx 安装SSL证书
     /usr/local/nginx/sbin/nginx-V  看一下是否有with-http_ssl_module模块#HTTPSserverusernginxnginx;worker_processes 8;#error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;#pid      ......
  • nginx hyperf ssl https 环境。hyperf-https-ssl
     usernginxnginx;worker_processes 8;#error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;#pid       logs/nginx.pid;events{   worker_connections 1024;}http{   include      mime.ty......
  • ECE 4514 数字设计
    ECE4514:DigitalDesignIISpring2023Thiscourseisdevotedtoadvanceddigitaldesigntechniquesfordevelopingcomplexdigitalcircuits.Itemphasizessystem-levelconceptsandhigh-leveldesignrepresentationsthatalsomeetparticulardesignconstr......
  • nginxWebUI--一款更好的管理nginx的软件
    背景博主之前搭建了一套k8s系统用来管理开发中常用的软件,以及项目的快速部署。但是在使用的过程中有个麻烦的问题是在于,k8s暴露出来的服务的端口号是限定范围内随机的。所以在我们访问部分服务的时候需要不得已的带上一些端口号,这样有点太麻烦了。能不能简单一点,正好我手上有个域......
  • Nginx web服务和虚拟web站点
    Nginxweb服务和虚拟web站点NginxNginx("enginex")是一个轻量级、高性能的WEB服务器软件。安装nginx依赖包[root@web01~]#yuminstall-ygccgcc-c++autoconfautomakezlibzlib-developensslopenssl-develpcrepcre-devel上传软件包并解压winscp传压缩包到linux;或者下......