如何在 Fedora 37 上安装 GitLab

Linux命令 Edge插件网 2年前 (2023-03-11) 502次浏览 已收录 0个评论

GitLab 提供了一个全面的、一体化的解决方案,用于管理 Git 存储库和协作处理软件项目,并提供用于测试、部署和项目管理的强大工具。如何在 Fedora 37 上安装 GitLab

在 Fedora 37 上安装 GitLab

第 1 步。在继续之前,请更新您的 Fedora 操作系统以确保所有现有软件包都是最新的。使用此命令更新服务器软件包:

<span class="pln">sudo dnf upgrade
sudo dnf update
sudo dnf install curl policycoreutils openssh</span><span class="pun">-</span><span class="pln">server</span>

第 2 步。在 Fedora 37安装 GitLab

默认情况下,GitLab 软件包不在 Fedora 37 的默认存储库中。现在运行以下命令将 GitLab 存储库添加到您的 Fedora 系统中:

<span class="pln">sudo curl https</span><span class="pun">:</span><span class="com">//packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash</span>

添加存储库后,现在使用以下命令更新系统并安装 GitLab 社区版 (CE) 包:

<span class="pln">sudo dnf install gitlab</span><span class="pun">-</span><span class="pln">ce</span>

输出:

<span class="pun">*.</span>                  <span class="pun">*.</span>
      <span class="pun">***</span>                 <span class="pun">***</span>
     <span class="pun">*****</span>               <span class="pun">*****</span>
    <span class="pun">.******</span>             <span class="pun">*******</span>
    <span class="pun">********</span>            <span class="pun">********</span>
   <span class="pun">,,,,,,,,,***********,,,,,,,,,</span>
  <span class="pun">,,,,,,,,,,,*********,,,,,,,,,,,</span>
  <span class="pun">.,,,,,,,,,,,*******,,,,,,,,,,,,</span>
      <span class="pun">,,,,,,,,,*****,,,,,,,,,.</span>
         <span class="pun">,,,,,,,****,,,,,,</span>
            <span class="pun">.,,,***,,,,</span>
                <span class="pun">,*,.</span><span class="pln">

     _______ __  __          __
    </span><span class="pun">/</span><span class="pln"> ____</span><span class="pun">(</span><span class="pln">_</span><span class="pun">)</span> <span class="pun">/</span><span class="pln">_</span><span class="str">/ /</span><span class="pln">   ____ _</span><span class="pun">/</span> <span class="pun">/</span><span class="pln">_
   </span><span class="str">/ /</span><span class="pln"> __</span><span class="pun">/</span> <span class="pun">/</span><span class="pln"> __</span><span class="str">/ /</span>   <span class="pun">/</span><span class="pln"> __ </span><span class="str">`/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/

Thank you for installing GitLab!</span>

第 3 步。配置 GitLab。

通过运行以下命令打开 GitLab 配置文件:

<span class="pln">nano </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">gitlab</span><span class="pun">/</span><span class="pln">gitlab</span><span class="pun">.</span><span class="pln">rb</span>

找到以下行并对其进行编辑以匹配您的域名或公共 IP 地址:

<span class="pln">external_url </span><span class="str">'http://gitlab.your-domain.com'</span>

保存并退出配置文件,然后通过运行以下命令重新配置 GitLab:

<span class="pln">gitlab</span><span class="pun">-</span><span class="pln">ctl reconfigure</span>

第 4 步。设置防火墙。

默认情况下,GitLab 对 HTTP 使用端口 80,对 HTTPS 使用端口 443。必须将防火墙配置为允许以下端口上的流量,以确保 GitLab 实例可访问:

<span class="pln">sudo firewall</span><span class="pun">-</span><span class="pln">cmd </span><span class="pun">--</span><span class="pln">permanent </span><span class="pun">--</span><span class="kwd">add</span><span class="pun">-</span><span class="pln">service</span><span class="pun">=</span><span class="pln">http
sudo firewall</span><span class="pun">-</span><span class="pln">cmd </span><span class="pun">--</span><span class="pln">permanent </span><span class="pun">--</span><span class="kwd">add</span><span class="pun">-</span><span class="pln">service</span><span class="pun">=</span><span class="pln">https
sudo firewall</span><span class="pun">-</span><span class="pln">cmd </span><span class="pun">--</span><span class="pln">reload</span>

第5步。访问 Gitlab Web 界面。

成功安装后,您可以通过访问 URL 访问 GitLab CE Web UI。您将看到以下页面:http://gitlab.your-domian.com

如何在 Fedora 37 上安装 GitLab

root 用户的密码是随机生成的,并在 中存储 24 小时。您可以使用以下命令检查密码:/etc/gitlab/initial_root_password

<span class="pln">cat </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">gitlab</span><span class="pun">/</span><span class="pln">initial_root_password</span>

感谢您使用本教程在您的 Fedora 37 系统上安装 GitLab。如需其他帮助或有用信息,我们建议您查看 GitLab 官方网站


Edge插件网 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:如何在 Fedora 37 上安装 GitLab
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址