溫馨提示×

GitLab Linux版怎樣配置

小樊
39
2025-08-19 17:40:13
欄目: 智能運維

以下是GitLab Linux版的一般配置步驟:

安裝依賴

  • Ubuntu/Debiansudo apt-get update,sudo apt-get install -y curl openssh-server ca-certificates postfix。
  • CentOS/RHELsudo yum install -y curl policycoreutils-python openssh-server postfix。

添加GitLab倉庫并安裝

  • Ubuntu/Debiancurl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash,sudo apt-get install gitlab-ce。
  • CentOS/RHELcurl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash,sudo yum install gitlab-ce。

配置GitLab

編輯/etc/gitlab/gitlab.rb文件,設置external_url為服務器IP或域名,如external_url 'http://your-server-ip'。若需修改端口,可將其設為external_url 'http://your-server-ip:port'。然后執行sudo gitlab-ctl reconfigure使配置生效。

啟動服務

sudo gitlab-ctl start,并設置開機自啟sudo systemctl enable gitlab。

訪問GitLab

在瀏覽器中輸入配置的external_url,首次登錄需設置root用戶密碼,可使用sudo cat /etc/gitlab/initial_root_password查看初始密碼。

0
亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女