AI摘要:
本文指导用户如何在 CentOS 7 上安装 GitLab,包括从清华大学开源软件镜像站下载指定版本的 GitLab,通过 rpm 命令安装,配置 external_url 为本地地址 http://127.0.0.1:9090,以及执行初始配置。完成安装后,管理员账户为 root,初始密码位于 /etc/gitlab/initial_root_password 文件中,该密码在初次配置24小时后自动删除。安装后,用户还可以修改界面语言以优化使用体验。文章还提到了使用 frp 和反向代理来实现外网访问的方法。

安装必要依赖

安装Gitlab

  1. 前往镜像仓库选择合适版本,通过wget下载到服务器:wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-16.9.3-ce.0.el7.x86_64.rpm
  2. 安装rpm -Uvh gitlab-ce-16.9.3-ce.0.el7.x86_64.rpm
    安装结束显示:

    It looks like GitLab has not been configured yet; skipping the upgrade script.
    
        *.                  *.
       ***                 ***
      *****               *****
     .******             *******
     ********            ********
    ,,,,,,,,,***********,,,,,,,,,
      ,,,,,,,,,,,*********,,,,,,,,,,,
      .,,,,,,,,,,,*******,,,,,,,,,,,,
       ,,,,,,,,,*****,,,,,,,,,.
          ,,,,,,,****,,,,,,
             .,,,***,,,,
                 ,*,.
    
    
    
      _______ __  __          __
     / ____(_) /_/ /   ____ _/ /_
    / / __/ / __/ /   / __ `/ __ \
      / /_/ / / /_/ /___/ /_/ / /_/ /
      \____/_/\__/_____/\__,_/_.___/
    
    
    Thank you for installing GitLab!
    GitLab was unable to detect a valid hostname for your instance.
    Please configure a URL for your GitLab instance by setting `external_url`
    configuration in /etc/gitlab/gitlab.rb file.
    Then, you can start your GitLab instance by running the following command:
      sudo gitlab-ctl reconfigure
    
    For a comprehensive list of configuration options please see the Omnibus GitLab readme
    https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
    
    Help us improve the installation experience, let us know how we did with a 1 minute survey:
    https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnibus&release=16-9
  3. 编辑配置文件:vi /etc/gitlab/gitlab.rb,修改external_url为对应路径,这里设置http://127.0.0.1:9090
  4. sudo gitlab-ctl reconfigure执行设置,大约需要三分钟
  5. 管理员用户名为root,密码存储在/etc/gitlab/initial_root_password,初次配置24小时后自动删除
  6. 登录后可在preferences中修改语言,保存后刷新即可生效
  7. 使用frp+反向代理实现外网访问,反向代理设置配置文件设置端口对应frp穿透端口即可
文章目录