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

烟台制作网站软件镇江网站建设和优化推广多少钱

烟台制作网站软件,镇江网站建设和优化推广多少钱,网站优化及推广公司,做公司网站的好处nginx架构和安装 nginx架构和安装1.1 nginx架构1.2 安装nginx1.1.1 本地安装1.1.2 官网安装1.1.3 源码安装 1.3 控制服务1.4 页面自定义 nginx架构和安装 nginx是多进程组织模式,而且是一个由 Master 主进程和 Worker 工作进程组成 1.1 nginx架构 1.2 安装nginx …

nginx架构和安装

  • nginx架构和安装
    • 1.1 nginx架构
    • 1.2 安装nginx
      • 1.1.1 本地安装
      • 1.1.2 官网安装
      • 1.1.3 源码安装
    • 1.3 控制服务
    • 1.4 页面自定义

nginx架构和安装

nginx是多进程组织模式,而且是一个由 Master 主进程和 Worker 工作进程组成

1.1 nginx架构

在这里插入图片描述

1.2 安装nginx

dnf/yum安装记得挂载

ll /mnt #查看是否挂载
total 0
drwxr-xr-x. 2 root root 6 Oct 24 19:52 hgfs  ##未挂载
mount /dev/sr0 /mnt	 #挂载 /mnt 软件
mount: /mnt: WARNING: source write-protected, mounted read-only.
[root@localhost ~]# ll /mnt
total 44
drwxr-xr-x. 1 redhat redhat  2048 Oct 25  2023 AppStream
drwxr-xr-x. 1 redhat redhat  2048 Oct 25  2023 BaseOS
drwxrwxr-x. 1 redhat redhat  2048 Oct 25  2023 EFI
-r--r--r--. 1 redhat redhat  8154 Oct 25  2023 EULA
-r--r--r--. 1 redhat redhat  1455 Oct 25  2023 extra_files.json
-r--r--r--. 1 redhat redhat 18092 Oct 25  2023 GPL
drwxrwxr-x. 1 redhat redhat  2048 Oct 25  2023 images
drwxrwxr-x. 1 redhat redhat  2048 Oct 25  2023 isolinux
-r--r--r--. 1 redhat redhat   103 Oct 25  2023 media.repo
-r--r--r--. 1 redhat redhat  1669 Oct 25  2023 RPM-GPG-KEY-redhat-beta
-r--r--r--. 1 redhat redhat  3682 Oct 25  2023 RPM-GPG-KEY-redhat-release ##挂载成功
  • 本地安装(版本低)
  • 官网安装(较新版本)
  • 源码安装(最新版本)

1.1.1 本地安装

  1. 挂载
  2. dnf安装
[root@localhost ~]# ll /mnt
total 0
drwxr-xr-x. 2 root root 6 Oct 24 19:52 hgfs
[root@localhost ~]# mount /dev/sr0 /mnt
mount: /mnt: WARNING: source write-protected, mounted read-only.
[root@localhost ~]# ll /mnt
total 44
drwxr-xr-x. 1 redhat redhat  2048 Oct 25  2023 AppStream
drwxr-xr-x. 1 redhat redhat  2048 Oct 25  2023 BaseOS
drwxrwxr-x. 1 redhat redhat  2048 Oct 25  2023 EFI
-r--r--r--. 1 redhat redhat  8154 Oct 25  2023 EULA
-r--r--r--. 1 redhat redhat  1455 Oct 25  2023 extra_files.json
-r--r--r--. 1 redhat redhat 18092 Oct 25  2023 GPL
drwxrwxr-x. 1 redhat redhat  2048 Oct 25  2023 images
drwxrwxr-x. 1 redhat redhat  2048 Oct 25  2023 isolinux
-r--r--r--. 1 redhat redhat   103 Oct 25  2023 media.repo
-r--r--r--. 1 redhat redhat  1669 Oct 25  2023 RPM-GPG-KEY-redhat-beta
-r--r--r--. 1 redhat redhat  3682 Oct 25  2023 RPM-GPG-KEY-redhat-release
[root@localhost ~]# dnf install nginx -y
Updating Subscription Management repositories.
Unable to read consumer identityThis system is not registered with an entitlement server. You can use subscription-manager to register.Last metadata expiration check: 7:13:29 ago on Sun 27 Oct 2024 02:59:41 PM CST.
Dependencies resolved.
======================================================================================================Package                     Architecture    Version                         Repository          Size
======================================================================================================
Installing:nginx                       x86_64          1:1.20.1-14.el9_2.1             appstream           40 k
Installing dependencies:nginx-core                  x86_64          1:1.20.1-14.el9_2.1             appstream          574 knginx-filesystem            noarch          1:1.20.1-14.el9_2.1             appstream           11 kredhat-logos-httpd          noarch          90.4-2.el9                      appstream           18 kTransaction Summary
======================================================================================================
Install  4 PackagesTotal size: 643 k
Installed size: 1.8 M
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transactionPreparing        :                                                                              1/1 Running scriptlet: nginx-filesystem-1:1.20.1-14.el9_2.1.noarch                                  1/4 Installing       : nginx-filesystem-1:1.20.1-14.el9_2.1.noarch                                  1/4 Installing       : nginx-core-1:1.20.1-14.el9_2.1.x86_64                                        2/4 Installing       : redhat-logos-httpd-90.4-2.el9.noarch                                         3/4 Installing       : nginx-1:1.20.1-14.el9_2.1.x86_64                                             4/4 Running scriptlet: nginx-1:1.20.1-14.el9_2.1.x86_64                                             4/4 Verifying        : nginx-1:1.20.1-14.el9_2.1.x86_64                                             1/4 Verifying        : nginx-core-1:1.20.1-14.el9_2.1.x86_64                                        2/4 Verifying        : nginx-filesystem-1:1.20.1-14.el9_2.1.noarch                                  3/4 Verifying        : redhat-logos-httpd-90.4-2.el9.noarch                                         4/4 
Installed products updated.Installed:nginx-1:1.20.1-14.el9_2.1.x86_64                     nginx-core-1:1.20.1-14.el9_2.1.x86_64         nginx-filesystem-1:1.20.1-14.el9_2.1.noarch          redhat-logos-httpd-90.4-2.el9.noarch          Complete!

成功安装版本 nginx-1:1.20.1-14.el9_2.1.x86_64

删除本地安装版本

dnf remove nginx -y
[root@localhost ~]# dnf remove nginx -y
Updating Subscription Management repositories.
Unable to read consumer identityThis system is not registered with an entitlement server. You can use subscription-manager to register.Dependencies resolved.
======================================================================================================Package                     Architecture    Version                        Repository           Size
======================================================================================================
Removing:nginx                       x86_64          1:1.20.1-14.el9_2.1            @appstream          148 k
Removing unused dependencies:nginx-core                  x86_64          1:1.20.1-14.el9_2.1            @appstream          1.6 Mnginx-filesystem            noarch          1:1.20.1-14.el9_2.1            @appstream            0  redhat-logos-httpd          noarch          90.4-2.el9                     @appstream           12 kTransaction Summary
======================================================================================================
Remove  4 PackagesFreed space: 1.8 M
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transactionPreparing        :                                                                              1/1 Running scriptlet: nginx-1:1.20.1-14.el9_2.1.x86_64                                             1/4 Erasing          : nginx-1:1.20.1-14.el9_2.1.x86_64                                             1/4 Running scriptlet: nginx-1:1.20.1-14.el9_2.1.x86_64                                             1/4 Erasing          : redhat-logos-httpd-90.4-2.el9.noarch                                         2/4 Erasing          : nginx-core-1:1.20.1-14.el9_2.1.x86_64                                        3/4 Erasing          : nginx-filesystem-1:1.20.1-14.el9_2.1.noarch                                  4/4 Running scriptlet: nginx-filesystem-1:1.20.1-14.el9_2.1.noarch                                  4/4 Verifying        : nginx-1:1.20.1-14.el9_2.1.x86_64                                             1/4 Verifying        : nginx-core-1:1.20.1-14.el9_2.1.x86_64                                        2/4 Verifying        : nginx-filesystem-1:1.20.1-14.el9_2.1.noarch                                  3/4 Verifying        : redhat-logos-httpd-90.4-2.el9.noarch                                         4/4 
Installed products updated.Removed:nginx-1:1.20.1-14.el9_2.1.x86_64                     nginx-core-1:1.20.1-14.el9_2.1.x86_64         nginx-filesystem-1:1.20.1-14.el9_2.1.noarch          redhat-logos-httpd-90.4-2.el9.noarch          Complete!

1.1.2 官网安装

  1. 挂载
  2. 配置仓库
  3. 安装

首先打开官方网址: www.nginx.org
在这里插入图片描述
单击 packages 链接
在这里插入图片描述
单击 RHEL and derivatives 链接
在这里插入图片描述
在这里插入图片描述

[nginx-stable]name=nginx stable repobaseurl=http://nginx.org/packages/centos/$releasever/$basearch/gpgcheck=1enabled=1gpgkey=https://nginx.org/keys/nginx_signing.keymodule_hotfixes=true[nginx-mainline]name=nginx mainline repobaseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/gpgcheck=1enabled=0gpgkey=https://nginx.org/keys/nginx_signing.keymodule_hotfixes=true
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ll
total 8
-rw-r--r--. 1 root root 358 Oct 24 20:10 redhat.repo
-rw-r--r--. 1 root root 115 Oct 27 11:12 wangluo.repo
[root@localhost yum.repos.d]# rm -rf wangluo.repo
[root@localhost yum.repos.d]# ll
total 4
-rw-r--r--. 1 root root 358 Oct 24 20:10 redhat.repo
[root@localhost yum.repos.d]# vim nginx.repo
[root@localhost yum.repos.d]# cd
[root@localhost ~]# dnf install nginx -y
Updating Subscription Management repositories.
Unable to read consumer identityThis system is not registered with an entitlement server. You can use subscription-manager to register.nginx stable repo                                                     9.0 kB/s |  39 kB     00:04    
Last metadata expiration check: 0:00:01 ago on Sun 27 Oct 2024 10:34:25 PM CST.
Dependencies resolved.
======================================================================================================Package           Architecture       Version                          Repository                Size
======================================================================================================
Installing:nginx             x86_64             1:1.26.2-1.el9.ngx               nginx-stable             996 kTransaction Summary
======================================================================================================
Install  1 PackageTotal download size: 996 k
Installed size: 3.3 M
Downloading Packages:
nginx-1.26.2-1.el9.ngx.x86_64.rpm                                      23 kB/s | 996 kB     00:42    
------------------------------------------------------------------------------------------------------
Total                                                                  23 kB/s | 996 kB     00:42     
nginx stable repo                                                     3.1 kB/s |  12 kB     00:03    
Importing GPG key 0xB49F6B46:Userid     : "nginx signing key <signing-key-2@nginx.com>"Fingerprint: 8540 A6F1 8833 A80E 9C16 53A4 2FD2 1310 B49F 6B46From       : https://nginx.org/keys/nginx_signing.key
Key imported successfully
Importing GPG key 0x7BD9BF62:Userid     : "nginx signing key <signing-key@nginx.com>"Fingerprint: 573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62From       : https://nginx.org/keys/nginx_signing.key
Key imported successfully
Importing GPG key 0x8D88A2B3:Userid     : "nginx signing key <signing-key-3@nginx.com>"Fingerprint: 9E9B E90E ACBC DE69 FE9B 204C BCDC D8A3 8D88 A2B3From       : https://nginx.org/keys/nginx_signing.key
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transactionPreparing        :                                                                              1/1 Running scriptlet: nginx-1:1.26.2-1.el9.ngx.x86_64                                              1/1 Installing       : nginx-1:1.26.2-1.el9.ngx.x86_64                                              1/1 Running scriptlet: nginx-1:1.26.2-1.el9.ngx.x86_64                                              1/1 
----------------------------------------------------------------------Thanks for using nginx!Please find the official documentation for nginx here:
* https://nginx.org/en/docs/Please subscribe to nginx-announce mailing list to get
the most important news about nginx:
* https://nginx.org/en/support.htmlCommercial subscriptions for nginx are available on:
* https://nginx.com/products/----------------------------------------------------------------------Verifying        : nginx-1:1.26.2-1.el9.ngx.x86_64                                              1/1 
Installed products updated.Installed:nginx-1:1.26.2-1.el9.ngx.x86_64                                                                     Complete!

成功安装版本 nginx-1:1.26.2-1.el9.ngx.x86_64

1.1.3 源码安装

在这里插入代码片

成功安装版本 nginx-1:1.28.2-1.el9.ngx.x86_64

1.3 控制服务

nginx -s signal
signal有以下几种:

stop 快速关闭
quit 优雅关闭
reload 重新加载配置文件
reopen 重新打开日志文件

启动服务:

 [root@kittod ~]# nginx[root@kittod ~]# netstat -lntup | grep nginxtcp        
0      
2929/nginx: master  
tcp6       
0 0.0.0.0:80              
0      
0 :::80                   
2929/nginx: master 

停止服务:

[root@kittod ~]# nginx -s stop
[root@kittod ~]# netstat -lntup | grep nginx

1.4 页面自定义

 [root@kittod ~]# netstat -lntup | grep nginxtcp        
0      
0 0.0.0.0:80              
2946/nginx: master  
tcp6       
0      
0 :::80                   
2946/nginx: master  
0.0.0.0:*               
:::*                    
LISTEN   
LISTEN   
[root@kittod ~]# curl localhost...<a href="https://apache.org">Apache&trade;</a> is a registered 
trademark of <a href="https://apache.org">the Apache Software Foundation</a> 
in the United States and/or other countries.<br /><a href="https://nginx.com">NGINX&trade;</a> is a registered 
trademark of <a href="https://www.f5.com">F5 Networks, Inc.</a>.</div></body></html>[root@kittod ~]# 
[root@kittod ~]# ll /usr/share/nginx/html/
http://www.yayakq.cn/news/844587/

相关文章:

  • 一个网站需要多少容量电商培训
  • 苏州高端网站建设kgwl网站报名照片怎么做
  • 网站还没有建好可以备案吗亚马逊云服务器
  • 网站开发毕业设计评审表网站建设工作室北京小俊哥
  • 怎么样查看网站开发语言dux5.3 wordpress
  • 东莞微信网站建设更好开发者模式怎么关闭vivo
  • 企业设计网站建设教育局网站硬件价格需要多少钱
  • 如何在门户网站做搜索引擎网站开发的流程
  • 网站建设前期工作家庭优化大师下载
  • 湖北外贸网站建设多少钱微信公众号和小程序的区别
  • 网站原创页面济南传承网站建设李聪
  • 游戏门户网站开发资源网站开发专业实习报告
  • diywap手机网站系统优化网站seo方案
  • 做名片去哪个网站溧阳做网站的哪家好
  • 在哪个网站做外快设计公司域名不变网站做变动
  • 张家港做网站费用餐厅网站建设策划方案
  • 刷关键词要刷大词吗苏州百度seo关键词优化
  • 整形网站 源码秦皇岛做网站公司汉狮价格
  • 东莞市门户网站建设怎么样中企动力云邮箱
  • h5都用什么网站南京洛可可设计公司
  • 英文网站设计公司网站首页页面代码
  • 代驾网站开发网站建设思企互联
  • 企业为什么要建站台呢安卓开发需要什么技术
  • 织梦网网站建设seo网站排名优化案例
  • 网站和域名都注册怎么连接成网址网站都有服务器吗
  • 谈谈网站建设会有哪些问题如何做网络营销能成功呢
  • 企业网站建设实训总结顺企网吉安网站建设
  • 做海报创意网站怎么样上传网站资料
  • 常熟网站开发2022年最火的关键词
  • 导航网站备案手机如何制作软件app