一、安装相应所需依赖包

yum install lokkit
yum install curl openssh-server openssh-clients postfix cronie -y
service postfix start
chkconfig postfix on
lokkit -s http -s ssh
curl -sS http://packages.gitlab.cc/install/gitlab-ce/script.rpm.sh | sudo bash

二、添加gitlab仓库并安装

curl -sS http://packages.gitlab.cc/install/gitlab-ce/script.rpm.sh | sudo bash
yum -y install gitlab-ce

三、修改配置文件并启动

1、vim /etc/gitlab/gitlab.rb
        external_url 'http://gitlab.xxxxx.com'
2、重新加载配置
        gitlab-ctl reconfigure
3、重启gitlab
        gitlab-clt restart