1. 安装相关依赖
yum -y install policycoreutils openssh-server openssh-clients postfix
2. 启动ssh服务&设置为开机启动
systemctl enable sshd
systemctl start sshd
3. 设置postfix开机自启,并启动,postfix支持gitlab发信功能
systemctl enable postfix systemctl start postfix
4. 开放ssh以及http服务,然后重新加载防火墙列表
firewall-cmd --add-service=ssh --permanent
firewall-cmd --add-service=http --permanent
firewall-cmd --reload
如果关闭防火墙就不需要做以上配置
5. 添加GitLab仓库,并安装到服务器上:
curl -sS http://packages.gitlab.cc/install/gitlab-ce/script.rpm.sh | sudo bash
yum -y install gitlab-ce
6. 修改gitlab配置
vim /etc/gitlab/gitlab.rb
修改gitlab访问地址和端口,ip改为自己的ip,端口默认为80,改为8081
external_url 'http://192.168.229.130:8081'
7. 重载配置及启动gitlab
gitlab-ctl reconfigure
gitlab-ctl restart
8. 把端口添加到防火墙(关闭防火墙时不用配置)
firewall-cmd --zone=public --add-port=82/tcp --permanent
firewall-cmd --reload
9. 登录修改密码
浏览器输入 http://192.168.229.130:8081/ ,第一次进入页面修改root密码
10. 用户名:root,使用上面修改的密码登录