美文网首页
centOS7.4搭建gitlab服务器

centOS7.4搭建gitlab服务器

作者: SEL_fish | 来源:发表于2018-07-05 14:55 被阅读0次

    1、安装依赖软件
    执行命令:yum -y install policycoreutils openssh-server openssh-clients postfix
    (如果没有policycoreutils-python,需要执行:yum install policycoreutils-python)
    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
    查看要下载的版本,以10.0.0为例
    wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
    进行安装:
    rpm -i gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
    4、修改gitlab配置文件指定服务器ip和自定义端口:
    vm /etc/gitlab/gitlab.rb
    external_url "http://ip地址"
    修改后保存退出
    5、重置并启动GitLab
    执行命令:gitlab-ctl reconfigure
    gitlab-ctl restart
    提示“ok: run:”表示启动成功
    6、访问 GitLab页面
    在浏览器中输入ip:port
    设置root用户的密码
    7、设置gitlab发信功能
    发信系统用的默认的postfix,smtp是默认开启的,两个都启用了,两个都不会工作。
    我这里设置关闭smtp,开启postfix
    关闭smtp方法:vim /etc/gitlab/gitlab.rb
    找到#gitlab_rails['smtp_enable'] = true 改为 gitlab_rails['smtp_enable'] = false
    修改后执行命令:gitlab-ctl reconfigure
    gitlab-ctl restart
    重新登录界面添加用户成功邮箱会收到修改密码的邮件

    相关文章

      网友评论

          本文标题:centOS7.4搭建gitlab服务器

          本文链接:https://www.haomeiwen.com/subject/qkxkhftx.html