Centos 7 gitlab 安裝教程
1. 安裝依賴軟體 yum -y install policycoreutils openssh-server openssh-clients postfix 2.設定postfix開機自啟,並啟動,postfix支援gitlab發信功能 systemctl enable postfix systemctl start postfix 3.下載gitlab安裝包,然後安裝 centos 6系統的下載地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6 centos 7系統的下載地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7 下載rpm包並安裝: wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-8.0.0-ce.0.el7.x86_64.rpm rpm -i (下載的gitlab.rpm) 4.修改gitlab配置檔案指定伺服器ip和自定義埠: vim /etc/gitlab/gitlab.rb
:wq 退出並儲存
修改埠 external_url 'ip:port'
ps:注意這裡設定的埠不能被佔用,預設是8080埠,如果8080已經使用,請自定義其它埠,並在防火牆設定開放相對應得埠,如果配置郵件傳送,郵件會將external_url作為訪問地址。
5.重置並啟動GitLab
執行:
重新編譯 gitlab-ctl reconfigure
重新啟動 gitlab-ctl restart
6.修改配置檔案vim /etc/gitlab/gitlab.rb,新增如下配置; 找到【GitLab email server settings】,在其中新增下如配置: # 以下為阿里雲企業郵箱的配置 gitlab_rails['smtp_enable'] = true gitlab_rails['smtp_address'] = "smtp.mxhichina.com" gitlab_rails['smtp_port'] = 25 gitlab_rails['smtp_user_name'] = "***@emjwash.com" gitlab_rails['smtp_password'] = "******" gitlab_rails['smtp_domain'] = "emjwash.com" gitlab_rails['smtp_authentication'] = "login" gitlab_rails['smtp_enable_starttls_auto'] = true gitlab_rails['gitlab_email_from'] = '***@emjwash.com'
重新編譯 gitlab-ctl reconfigure