簡介:
GitLab是一個利用Ruby on Rails開發的開源應用程序,實現一個自托管的Git項目倉庫,可通過Web界面進行訪問公開的或者私人項目.
安裝命令:
sudo yum install curl policycoreutils openssh-server openssh-clients sudo systemctl enable sshd sudo systemctl start sshd sudo yum install postfix sudo systemctl enable postfix sudo systemctl start postfix
添加GitLab倉庫,並安裝到服務器上:
curl -sS http://packages.gitlab.cc/install/gitlab-ce/script.rpm.sh | sudo bash sudo yum install gitlab-ce
使用瀏覽器訪問GitLab:

置並啟動gitlab-ce
vim /etc/gitlab/gitlab.rb
把external_url = 'http://git.example.com'修改為自己的IP地址,例如我的ip:http://192.168.8.54:8091,端口號注意不要與其他的沖突

修改完成后:wq保存退出,執行以下命令,讓配置生效
gitlab-ctl reconfigure

gitlab-ctl start

訪問gitlab頁面出現502錯誤

出現這個問題,主要是因為8080端口被占用,之前安裝tomcat默認的是8080端口,netstat -ntpl查看端口情況

輸入 kill -9 1339 殺掉8080端口對應的program
再刷新下頁面即可進入到Gitlab頁面

為了避免8080端口沖突問題,可以修改下unicorn的默認端口,vim打開/etc/gitlab/gitlab.rb配置文件
新增一項unicorn['port'] = 8092,修改后內容如下

修改完成后:wq保存退出,執行gitlab-ctl reconfigure命令,讓配置生效,再重新啟動服務 gitlab-ctl restart

然后注冊

登錄

