1.安装相关依赖 yum install -y curl openssh-server openssh-clients postfix cronie policycoreutils-python

2.启动postfix,并设置位开机启动 systemctl restart postfix systemctl enable postfix

3.防火墙设置 #此命令需在防火墙开启后使用 firewall-cmd --add-service=http --permanent firewall-cmd –reload

4.关闭防火墙 systemctl stop firewalld setenforce 0

5.安装gitlab wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-8.6.7-ce.0.el7.x86_64.rpm

6.安装rpm包 rpm -ivh gitlab-ce-8.6.7-ce.0.el7.x86_64.rpm

7.修改配置文件gitlab.rb Vim /etc/gitlab/gitlab.rb 查找到 external_url 这个属性,将其改为ip+地址(external_url 'http://localhost')

8.加载配置文件并启动 gitlab-ctl reconfigure gitlab-ctl restart

全部成功即可



9.首次登陆需要自己设置密码 默认账号为 : root 设置密码 :12345678


注:gitlab在服务器中的默认代码存放的位置是

/var/opt/gitlab/git-data/repositories

访问IP页面测试成功: