1. 程式人生 > >Git伺服器搭建過程

Git伺服器搭建過程

Git伺服器搭建過程 作者:家輝  日期:2018年3月16日 CSDN部落格: http://blog.csdn.net/gobitan 摘要:本文記錄了Gitlab伺服器的搭建過程,記錄下來備用。安裝的作業系統為CentOS7.
第一部分:安裝Gitlab 注意:建議用root使用者安裝,其他使用者sudo因為許可權問題容易出錯 安裝依賴包 # yum -y install curl policycoreutils postfix
啟動郵件服務 # sudo systemctl start postfix
開啟開機自啟動
#sudo systemctl enable postfix
新增安裝源 #curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
安裝gitlab社群版gitlab-ce # sudo yum -y install gitlab-ce 注:當前版本 10.5.3-ce.0.el7
第二部分:配置Gitlab 修改配置 sudo vi /etc/gitlab/gitlab.rb
修改#external_url '
http://gitlab.example.com
'為: external_url 'http://172.27.2.1xx' 注意:172.27.2.1xx為你的IP地址,需要修改。
修改預設埠 nginx['listen_port'] = 18080
然後重啟 # gitlab-ctl reconfigure
然後已經可以訪問了:http://172.27.2.1xx:18080,第一次要修改root使用者的密碼.
禁止使用者註冊
http://172.27.2.1xx:18080/admin/application_settings 在"Sign-up Restrictions"部分,去掉" Sign-up enabled
"的打鉤,然後儲存。
停止gitlab
gitlab-ctl stop
參考資料: [1]  https://www.howtoforge.com/tutorial/how-to-install-and-configure-gitlab-ce-on-centos-7/  [2]  https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.m