在Rocky Linux 8.10上安装Nginx

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

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>

<think>我们正在寻找在Rocky Linux 8.10安装名为"manage"的软件或工具的方法。由于"manage"是一个比较通用的名字,我们需要进一步确定具体是指什么软件。然而,根据提供的引用,我们有一些线索: 1. 引用[1]和[3]提到了Rocky Linux(或rocklinux)的部署和安装,特别是引用[3]提到了使用Cobbler安装RockyLinux操作系统。 2. 引用[2]详细描述了Cobbler自动装机服务的搭建步骤,包括导入epel源和安装依赖包。 3. 引用[4]提到了MySQL MHA(Master High Availability)的安装与配置。 4. 引用[5]则涉及网络接口命名规则和GRUB配置文件的编辑。 用户的问题是在Rocky Linux 8.10安装名为"manage"的软件。结合引用,我们注意到: - 引用[2]中提到了Cobbler,它是一个用于系统安装的服务,而Cobbler有一个Web管理界面,可能被称为“manage”? - 引用[4]中提到了MHA(MySQL Master High Availability),它有一个管理工具叫做`masterha_manager`,可能用户指的“manage”是MHA的管理工具? 但是,用户明确提到的是“名为manage的软件或工具”,所以我们不能确定。因此,我们需要采取以下步骤: 1. 首先,我们可以尝试在Rocky Linux 8.10的默认仓库中搜索名为“manage”的软件包。 2. 如果默认仓库中没有,可以尝试EPEL仓库,因为Rocky Linux兼容RHEL/CentOS,而EPEL是常用的额外仓库。 3. 如果仍然找不到,考虑是否用户指的是某个特定软件的管理工具(如Cobbler-web或MHA的管理脚本)。 根据引用[2],我们知道在Rocky Linux/CentOS中可以使用yum/dnf来安装软件。同时,引用[2]和[3]都提到了EPEL仓库,所以我们可以启用EPEL仓库来扩大搜索范围。 因此,我们可以这样回答: ### 安装名为“manage”的软件的方法 由于“manage”可能指代多个软件,我们首先尝试在Rocky Linux 8.10的仓库中搜索。请按照以下步骤操作: #### 步骤1:更新系统并启用EPEL仓库 在Rocky Linux 8.10中,默认可能没有安装EPEL仓库。我们可以先安装EPEL仓库,因为许多额外的软件包都在其中。 ```bash sudo dnf update -y sudo dnf install epel-release -y ``` #### 步骤2:搜索名为“manage”的软件包 使用以下命令搜索: ```bash sudo dnf search manage ``` 这会列出所有包含“manage”关键字的软件包。请仔细查看输出,看是否有与您需求匹配的软件包。 #### 步骤3:安装搜索到的软件包 如果找到合适的软件包,例如假设包名为`some-manage-package`,则使用: ```bash sudo dnf install some-manage-package -y ``` #### 如果未找到合适的软件包? 如果通过上述步骤没有找到,那么可能需要考虑“manage”是否是指某个特定软件的管理组件。例如: - **Cobbler-web**:如果您想管理Cobbler服务,可以安装Cobbler的Web界面(cobbler-web)。安装方法(确保已经安装了Cobbler): ```bash sudo dnf install cobbler-web -y ``` - **MySQL MHA**:如果您指的是MySQL的高可用管理工具,那么您需要安装MHA(MySQL Master High Availability)管理节点。但请注意,MHA通常不在默认仓库中,需要从其他来源安装。 引用[4]中提到了MHA的配置文件,但没有直接给出安装方法。通常,安装MHA需要从Perl的CPAN或第三方仓库获取。您可以参考以下步骤: 1. 安装必要的依赖: ```bash sudo dnf install perl-DBD-MySQL perl-Config-Tiny perl-Log-Dispatch perl-Parallel-ForkManager -y ``` 2. 从CPAN安装MHA: ```bash sudo cpan install MHA::Manager ``` 或者,您也可以从GitHub克隆源代码并安装: ```bash git clone https://github.com/yoshinorim/mha4mysql-manager.git cd mha4mysql-manager perl Makefile.PL make sudo make install ``` #### 步骤4:其他可能性 如果上述都不符合,请提供更多关于“manage”软件的信息,例如: - 该软件的功能是什么? - 是否有其他相关的名称或描述? 这样可以帮助我们更准确地定位。 ### 注意事项 - Rocky Linux 8.10使用dnf作为包管理器,与CentOS 8和RHEL 8兼容。 - 确保您的系统已经正确配置了网络和仓库。 如果您有更多细节,请提供以获取更精确的帮助。 ### 相关问题 1. 如何在Rocky Linux 8.10安装Cobbler服务? 2. 如何配置Rocky Linux的EPEL仓库? 3. 如何在Rocky Linux安装MySQL MHA工具? </think>### Rocky Linux 8.10 安装 "manage" 软件的方法 根据您的需求,**"manage"** 可能指代多种工具(如系统管理工具、特定软件的管理组件等)。结合您提供的引用内容,以下是几种可能的安装场景和方法: --- #### **场景1:安装 Cobbler 管理系统(引用[2][3])** 若您需要部署**自动化装机管理系统**(如引用[2][3]提到的 Cobbler): 1. **启用 EPEL 仓库**: ```bash sudo dnf install epel-release -y sudo dnf update -y ``` 2. **安装 Cobbler**: ```bash sudo dnf install cobbler cobbler-web -y ``` 3. **启动服务**: ```bash sudo systemctl enable --now cobblerd httpd ``` 4. **验证安装**: ```bash sudo cobbler version ``` --- #### **场景2:安装 MySQL 高可用管理器 MHA(引用[4])** 若您需要 **MySQL 高可用管理工具**(如引用[4]中的 `masterha_manager`): 1. **安装依赖**: ```bash sudo dnf install perl-DBD-MySQL perl-Config-Tiny perl-Log-Dispatch -y ``` 2. **从源码安装 MHA Manager**: ```bash git clone https://github.com/yoshinorim/mha4mysql-manager.git cd mha4mysql-manager perl Makefile.PL make sudo make install ``` 3. **配置文件路径**: 参考引用[4],配置文件通常位于 `/data/mha/mha_3306.cnf`。 --- #### **场景3:通用系统管理工具** 若您需要通用系统管理工具(如 Cockpit 或 Webmin): 1. **安装 Cockpit(官方推荐)**: ```bash sudo dnf install cockpit -y sudo systemctl enable --now cockpit.socket ``` 访问地址: `https://<服务器IP>:9090` 2. **安装 Webmin(第三方)**: ```bash sudo dnf install perl perl-Net-SSLeay -y sudo curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh sudo sh setup-repos.sh sudo dnf install webmin -y ``` --- #### **关键注意事项** 1. **仓库配置**: Rocky Linux 8.10 需确保基础仓库已配置(引用[1]): ```bash sudo sed -i 's|^mirrorlist=|#mirrorlist=|g' /etc/yum.repos.d/Rocky-*.repo sudo sed -i 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.aliyun.com/rockylinux|g' /etc/yum.repos.d/Rocky-*.repo ``` 2. **网络与依赖**: - 确保网络连通(引用[2][5])。 - 若遇到依赖问题,尝试 `sudo dnf groupinstall "Development Tools"`。 --- ### 总结建议 - ✅ **优先确认具体需求**:"manage" 可能指代特定工具(如 Cobbler 的 Web 界面或 MHA 管理器),请根据实际场景选择。 - ✅ **推荐操作**: 若需自动化部署系统,选择安装 Cobbler(场景1); 若需 MySQL 高可用管理,选择安装 MHA(场景2); 若需通用管理面板,选择 Cockpit(场景3)。 > **引用说明**: > Cobbler 安装流程参考了自动化装机服务部署步骤[^2]和 Rocky Linux 系统部署实践[^3];MySQL MHA 配置参考了高可用集群安装文档[^4];仓库配置方法参考了 Rocky Linux 镜像替换指南[^1]。 --- ###
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值