当前位置: > 其它学习 > 日常运维 >

CentOS 7安装 Gitlab

时间:2019-01-28 02:56来源:it 作者:IT

[root@localhost ~]yum install -y curl policycoreutils-pythonopenssh-server

[root@localhost ~]# systemctl enable sshd  

[root@localhost ~]# systemctl start sshd

 

[root@localhost ~]# yum install firewalld systemd -y

[root@localhost ~]# service firewalld  start

[root@localhost ~]# sudo firewall-cmd --permanent --add-service=http

[root@localhost ~]# sudo systemctl reload firewalld

[root@localhost ~]# curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

[root@localhost ~]yum install gitlab-ce

[root@localhost ~]vim /etc/gitlab/gitlab.rb

(1). 配置访问ip及端口或使用域名
external_url 'http://127.0.0.1'

(2). 配置email邮件发送(此处已163邮箱做示例),其他邮箱可参照:https://docs.gitlab.com/omnibus/settings/smtp.html

    # 配置发送邮箱

    gitlab_rails['smtp_enable'] = true

    gitlab_rails['smtp_address'] = "smtp.163.com"

    gitlab_rails['smtp_port'] = 25

     gitlab_rails['smtp_user_name'] = "smtp user@163.com"

    gitlab_rails['smtp_password'] = "password"

    gitlab_rails['smtp_domain'] = "163.com"

    gitlab_rails['smtp_authentication'] = "login"

    gitlab_rails['smtp_enable_starttls_auto'] = true

    # 修改gitlab配置的发信人

    gitlab_rails['gitlab_email_from'] = "smtp user@163.com"

    user["git_user_email"] = "smtp user@163.com"

  (3). 重启服务以便应用以上配置

    sudo gitlab-ctl reconfigure

打开网址: http://127.0.0.1 (注:如安装了Apache占用80端口,请更改Apache的默认端口)

 


 

(责任编辑:IT)
------分隔线----------------------------