在Rocky Linux 8.10上安装Nginx

news2025/5/23 20:08:43

如果没有配置操作系统安装源,并且不连接网络,先配置安装源。

sudo dnf install nginx

sudo systemctl enable nginx
sudo systemctl start nginx

systemctl status nginx

curl http://ip

[root@rocky810 work]# sudo dnf install nginx
Last metadata expiration check: 0:03:19 ago on Thu 22 May 2025 10:25:40 AM CST.
Dependencies resolved.
========================================================================================================================================================================= Package                                          Architecture                Version                                                     Repository                Size
=========================================================================================================================================================================Installing:
 nginx                                            x86_64                      1:1.14.1-9.module+el8.4.0+542+81547229                      APP                      566 k
Installing dependencies:
 nginx-all-modules                                noarch                      1:1.14.1-9.module+el8.4.0+542+81547229                      APP                       22 k
 nginx-filesystem                                 noarch                      1:1.14.1-9.module+el8.4.0+542+81547229                      APP                       23 k
 nginx-mod-http-image-filter                      x86_64                      1:1.14.1-9.module+el8.4.0+542+81547229                      APP                       34 k
 nginx-mod-http-perl                              x86_64                      1:1.14.1-9.module+el8.4.0+542+81547229                      APP                       45 k
 nginx-mod-http-xslt-filter                       x86_64                      1:1.14.1-9.module+el8.4.0+542+81547229                      APP                       32 k
 nginx-mod-mail                                   x86_64                      1:1.14.1-9.module+el8.4.0+542+81547229                      APP                       63 k
 nginx-mod-stream                                 x86_64                      1:1.14.1-9.module+el8.4.0+542+81547229                      APP                       84 k
Enabling module streams:
 nginx                                                                        1.14                                                                                      

Transaction Summary
=========================================================================================================================================================================Install  8 Packages

Total size: 870 k
Installed size: 2.0 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                 1/1 
  Running scriptlet: nginx-filesystem-1:1.14.1-9.module+el8.4.0+542+81547229.noarch                                                                                  1/8 
  Installing       : nginx-filesystem-1:1.14.1-9.module+el8.4.0+542+81547229.noarch                                                                                  1/8 
  Installing       : nginx-mod-http-image-filter-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64                                                                       2/8 
  Running scriptlet: nginx-mod-http-image-filter-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64                                                                       2/8 
  Installing       : nginx-mod-http-perl-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64                                                                               3/8 
  Running scriptlet: nginx-mod-http-perl-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64                                                                               3/8 
  Installing       : nginx-mod-http-xslt-filter-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64                                                                        4/8 
  Running scriptlet: nginx-mod-http-xslt-filter-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64                                                                        4/8 
  Installing       : nginx-mod-mail-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64                                                                                    5/8 
  Running scriptlet: nginx-mod-mail-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64                                                                                    5/8 
  Installing       : nginx-all-modules-1:1.14.1-9.module+el8.4.0+542+81547229.noarch                                                                                 6/8 
  Installing       : nginx-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64                                                                                             7/8 
  Running scriptlet: nginx-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64                                                                                             7/8 
  Installing       : nginx-mod-stream-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64                                                                                  8/8 
  Running scriptlet: nginx-mod-stream-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64                                                                                  8/8 
  Verifying        : nginx-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64                                                                                             1/8 
  Verifying        : nginx-all-modules-1:1.14.1-9.module+el8.4.0+542+81547229.noarch                                                                                 2/8 
  Verifying        : nginx-filesystem-1:1.14.1-9.module+el8.4.0+542+81547229.noarch                                                                                  3/8 
  Verifying        : nginx-mod-http-image-filter-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64                                                                       4/8 
  Verifying        : nginx-mod-http-perl-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64                                                                               5/8 
  Verifying        : nginx-mod-http-xslt-filter-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64                                                                        6/8 
  Verifying        : nginx-mod-mail-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64                                                                                    7/8 
  Verifying        : nginx-mod-stream-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64                                                                                  8/8 

Installed:
  nginx-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64                             nginx-all-modules-1:1.14.1-9.module+el8.4.0+542+81547229.noarch                        
  nginx-filesystem-1:1.14.1-9.module+el8.4.0+542+81547229.noarch                  nginx-mod-http-image-filter-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64              
  nginx-mod-http-perl-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64               nginx-mod-http-xslt-filter-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64               
  nginx-mod-mail-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64                    nginx-mod-stream-1:1.14.1-9.module+el8.4.0+542+81547229.x86_64                         

Complete!
[root@rocky810 work]# sudo systemctl enable nginx
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /usr/lib/systemd/system/nginx.service.
[root@rocky810 work]# sudo systemctl start nginx
[root@rocky810 work]# systemctl status nginx
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2025-05-22 10:29:29 CST; 17s ago
  Process: 18283 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
  Process: 18111 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
  Process: 18102 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
 Main PID: 18303 (nginx)
    Tasks: 5 (limit: 100490)
   Memory: 11.7M
   CGroup: /system.slice/nginx.service
           ├─18303 nginx: master process /usr/sbin/nginx
           ├─18304 nginx: worker process
           ├─18305 nginx: worker process
           ├─18306 nginx: worker process
           └─18307 nginx: worker process

May 22 10:29:28 rocky810 systemd[1]: Starting The nginx HTTP and reverse proxy server...
May 22 10:29:28 rocky810 nginx[18111]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
May 22 10:29:28 rocky810 nginx[18111]: nginx: configuration file /etc/nginx/nginx.conf test is successful
May 22 10:29:29 rocky810 systemd[1]: Started The nginx HTTP and reverse proxy server.
[root@rocky810 work]# curl http://10.11.13.60
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <head>
    <title>Test Page for the Nginx HTTP Server on Rocky Linux</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <style type="text/css">
      /*<![CDATA[*/
      body {
        background-color: #fff;
        color: #000;
        font-size: 0.9em;
        font-family: sans-serif, helvetica;
        margin: 0;
        padding: 0;
      }
      :link {
        color: #c00;
      }
      :visited {
        color: #c00;
      }
      a:hover {
        color: #f50;
      }
      h1 {
        text-align: center;
        margin: 0;
        padding: 0.6em 2em 0.4em;
        background-color: #10B981;
        color: #fff;
        font-weight: normal;
        font-size: 1.75em;
        border-bottom: 2px solid #000;
      }
      h1 strong {
        font-weight: bold;
        font-size: 1.5em;
      }
      h2 {
        text-align: center;
        background-color: #10B981;
        font-size: 1.1em;
        font-weight: bold;
        color: #fff;
        margin: 0;
        padding: 0.5em;
        border-bottom: 2px solid #000;
      }
      hr {
        display: none;
      }
      .content {
        padding: 1em 5em;
      }
      .alert {
        border: 2px solid #000;
      }

      img {
        border: 2px solid #fff;
        padding: 2px;
        margin: 2px;
      }
      a:hover img {
        border: 2px solid #294172;
      }
      .logos {
        margin: 1em;
        text-align: center;
      }
      /*]]>*/
    </style>
  </head>

  <body>
    <h1>Welcome to <strong>nginx</strong> on Rocky Linux!</h1>

    <div class="content">
      <p>
        This page is used to test the proper operation of the
        <strong>nginx</strong> HTTP server after it has been installed. If you
        can read this page, it means that the web server installed at this site
        is working properly.
      </p>

      <div class="alert">
        <h2>Website Administrator</h2>
        <div class="content">
          <p>
            This is the default <tt>index.html</tt> page that is distributed
            with <strong>nginx</strong> on Rocky Linux. It is located in
            <tt>/usr/share/nginx/html</tt>.
          </p>

          <p>
            You should now put your content in a location of your choice and
            edit the <tt>root</tt> configuration directive in the
            <strong>nginx</strong>
            configuration file
            <tt>/etc/nginx/nginx.conf</tt>.
          </p>

          <p>
            For information on Rocky Linux, please visit the
            <a href="https://www.rockylinux.org/">Rocky Linux website</a>. The
            documentation for Rocky Linux is
            <a href="https://www.rockylinux.org/"
              >available on the Rocky Linux website</a
            >.
          </p>
        </div>
      </div>

      <div class="logos">
        <a href="http://nginx.net/"
          ><img
            src="nginx-logo.png"
            alt="[ Powered by nginx ]"
            width="121"
            height="32"
        /></a>
        <a href="http://www.rockylinux.org/"><img
            src="poweredby.png"
            alt="[ Powered by Rocky Linux ]"
            width="88" height="31" /></a>
        
      </div>
    </div>
  </body>
</html>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2384121.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Mac如何允许安装任何来源软件?

打开系统偏好设置-安全性与隐私&#xff0c;点击右下角的解锁按钮&#xff0c;选择允许从任何来源。 如果没有这一选项&#xff0c;请到打开终端&#xff0c;输入命令行&#xff1a;sudo spctl --master-disable, 输入命令后回车&#xff0c;输入电脑的开机密码后回车。 返回“…

2025最新版Visual Studio Code for Mac安装使用指南

2025最新版Visual Studio Code for Mac安装使用指南 Installation and Application Guide to The Latest Version of Visual Studio Code in 2025 By JacksonML 1. 什么是Visual Studio Code&#xff1f; Visual Studio Code&#xff0c;通常被称为 VS Code&#xff0c;是由…

【嵙大o】C++作业合集

​ 参考&#xff1a; C swap&#xff08;交换&#xff09;函数 指针/引用/C自带-CSDN博客 Problem IDTitleCPP指针CPP引用1107 Problem A编写函数&#xff1a;Swap (I) (Append Code)1158 Problem B整型数据的输出格式1163 Problem C时间&#xff1a;24小时制转12小时制1205…

C++23 范围迭代器作为非范围算法的输入 (P2408R5)

文章目录 一、引言二、C23及范围迭代器的背景知识2.1 C23概述2.2 范围迭代器的概念 三、P2408R5提案的内容3.1 提案背景3.2 提案内容 四、范围迭代器作为非范围算法输入的优势4.1 代码简洁性4.2 提高开发效率4.3 更好的兼容性 五、具体的代码示例5.1 使用范围迭代器进行并行计算…

2025.05.20【Treemap】树图数据可视化技巧

Multi-level treemap How to build a treemap with group and subgroups. Customization Customize treemap labels, borders, color palette and more 文章目录 Multi-level treemapCustomization Treemap 数据可视化技巧什么是 TreemapTreemap 的应用场景如何在 R 中绘制 T…

深入了解Springboot框架的启动流程

目录 1、介绍 2、执行流程 1、运行run方法 2、初始化SpringApplication对象 1、确定容器类型 3、加载所有的初始化器 4、加载Spring上下文监听器 5、设置程序运行的主类 3、进入run方法 1、开启计时器 2、Headless模式配置 3、获取并启用监听器 4、准备环境 1、设…

LLaMA-Factory微调LLM-Research/Llama-3.2-3B-Instruct模型

1、GPU环境 nvidia-smi 2、pyhton环境安装 git clone https://github.com/hiyouga/LLaMA-Factory.git conda create -n llama_factory python3.10 conda activate llama_factory cd LLaMA-Factory pip install -e .[torch,metrics] 3、微调模型下载&#xff08;LLM-Research/…

3.8.1 利用RDD实现词频统计

在本次实战中&#xff0c;我们通过Spark的RDD实现了词频统计功能。首先&#xff0c;准备了包含单词的文件并上传至HDFS。接着&#xff0c;采用交互式方式逐步完成词频统计&#xff0c;包括创建RDD、单词拆分、映射为二元组、按键归约以及排序等操作。此外&#xff0c;还通过创建…

Spring Ioc和Aop,Aop的原理和实现案例,JoinPoint,@Aspect,@Before,@AfterReturning

DAY25.2 Java核心基础 Spring两大核心&#xff1a;Ioc和Aop IOC Ioc容器&#xff1a;装载bean的容器&#xff0c;自动创建bean 三种方式&#xff1a; 1、基于xml配置&#xff1a;通过在xml里面配置bean&#xff0c;然后通过反射机制创建bean&#xff0c;存入进Ioc容器中 …

[解决conda创建新的虚拟环境没用python的问题]

问题复现 使用conda create -n env的时候&#xff0c;在对应的虚拟环境的文件里面找不到对应的python文件 为什么 首先&#xff0c;我们来看一下创建环境时的触发链路&#xff1a; 这表明当前环境中找不到Python可执行文件。 解决方法 所以很明显&#xff0c;我们需要指定…

【C++】控制台小游戏

移动&#xff1a;W向上&#xff0c;S上下&#xff0c;A向左&#xff0c;D向右 程序代码&#xff1a; #include <iostream> #include <conio.h> #include <windows.h> using namespace std;bool gameOver; const int width 20; const int height 17; int …

配合本专栏前端文章对应的后端文章——从模拟到展示:一步步搭建传感器数据交互系统

对应文章&#xff1a;进一步完善前端框架搭建及vue-konva依赖的使用&#xff08;Vscode&#xff09;-CSDN博客 目录 一、后端开发 1.模拟传感器数据 2.前端页面呈现数据后端互通 2.1更新模拟传感器数据程序&#xff08;多次请求&#xff09; 2.2&#x1f9e9; 功能目标 …

springboot IOC

springboot IOC IoC Inversion of Control Inversion 反转 依赖注入 DI &#xff08;dependency injection &#xff09; dependency 依赖 injection 注入 Qualifier 预选赛 一文带你快速理解JavaWeb中分层解耦的思想及其实现&#xff0c;理解 IOC和 DI https://zhuanlan.…

Ajax01-基础

一、AJAX 1.AJAX概念 使浏览器的XMLHttpRequest对象与服务器通信 浏览器网页中&#xff0c;使用 AJAX技术&#xff08;XHR对象&#xff09;发起获取省份列表数据的请求&#xff0c;服务器代码响应准备好的省份列表数据给前端&#xff0c;前端拿到数据数组以后&#xff0c;展…

生成树协议(STP)配置详解:避免网络环路的最佳实践

生成树协议&#xff08;STP&#xff09;配置详解&#xff1a;避免网络环路的最佳实践 生成树协议&#xff08;STP&#xff09;配置详解&#xff1a;避免网络环路的最佳实践一、STP基本原理二、STP 配置示例&#xff08;华为交换机&#xff09;1. 启用生成树协议2. 配置根桥3. 查…

面向 C 语言项目的系统化重构实战指南

摘要: 在实际开发中,C 语言项目往往随着功能演进逐渐变得混乱:目录不清、宏滥用、冗余代码、耦合高、测试少……面对这样的“技术债积累”,盲目大刀阔斧只会带来更多混乱。本文结合 C 语言的特点,从项目评估、目录规划、宏与内联、接口封装、冗余剔除、测试与 CI、迭代重构…

Python Pandas库简介及常见用法

Python Pandas库简介及常见用法 一、 Pandas简介1. 简介2. 主要特点&#xff08;一&#xff09;强大的数据结构&#xff08;二&#xff09;灵活的数据操作&#xff08;三&#xff09;时间序列分析支持&#xff08;四&#xff09;与其他库的兼容性 3.应用场景&#xff08;一&…

第十六届蓝桥杯复盘

文章目录 1.数位倍数2.IPv63.变换数组4.最大数字5.小说6.01串7.甘蔗8.原料采购 省赛过去一段时间了&#xff0c;现在复盘下&#xff0c;省赛报完名后一直没准备所以没打算参赛&#xff0c;直到比赛前两天才决定参加&#xff0c;赛前两天匆匆忙忙下载安装了比赛要用的编译器ecli…

【已解决】HBuilder X编辑器在外接显示器或者4K显示器怎么界面变的好小问题

触发方式&#xff1a;主要涉及DPI缩放问题&#xff0c;可能在电脑息屏有概率触发 修复方式&#xff1a; 1.先关掉软件直接更改屏幕缩放&#xff0c;然后打开软件&#xff0c;再关掉软件恢复原来的缩放&#xff0c;再打开软件就好了 2.(不推荐&#xff09;右键HBuilder在属性里…

直线型绝对值位移传感器:精准测量的科技利刃

在科技飞速发展的今天&#xff0c;精确测量成为了众多领域不可或缺的关键环节。无论是工业自动化生产线上的精细操作&#xff0c;还是航空航天领域中对零部件位移的严苛把控&#xff0c;亦或是科研实验中对微小位移变化的精准捕捉&#xff0c;都离不开一款高性能的测量设备——…