CentOS 7 环境下 GitLab安装部署以及帐号初始化

1. 安装相关依赖git

1 yum install curl policycoreutils openssh-server openssh-clients -y
2 # 确保sshd启动(正常状况下, sshd是启动的)
3 systemctl enable sshd
4 systemctl start sshd

 

另外若是开启了防火墙, 注意设置防火墙的规则

 2. 引入yum源, 并安装gitlabbash

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
yum install gitlab-ce -y
# 配置并启动
gitlab-ctl reconfigure

若是设备配置比较低, 会在启动过程当中卡死, 建议最低双核2G内存服务器

若是当前服务器的808080端口均未被占用, 则直接能够经过服务器的ip或域名访问到后台(出现502没关系张,通常状况下是gitlab尚未起来)ssh

http://ip或域名

三、获取/修改超级管理员root的密码curl

#切换目录:
cd /opt/gitlab/bin
#执行 :下方 命令 开始初始化密码
sudo gitlab-rails console production
#在irb(main):001:0> 后面经过 u=User.where(id:1).first 来查找与切换帐号(User.all 能够查看全部用户)
u=User.where(id:1).first
#经过u.password='12345678'设置密码为12345678(这里的密码看本身喜欢):
u.password='12345678'
#经过u.password_confirmation='12345678' 再次确认密码
u.password_confirmation='12345678'
#经过 u.save!进行保存(切记切记 后面的 !)
u.save!
#若是看到上面截图中的true ,恭喜你已经成功了,执行 exit 退出当前设置流程便可。
exit

 四、重启gitlabgitlab

sudo gitlab-ctl restart

 五、经常使用命令url

# Start all GitLab components
gitlab-ctl start
# Stop all GitLab components
gitlab-ctl stop
# Restart all GitLab components
gitlab-ctl restart

 

回到gitlab ,能够经过 root/12345678 这一超级管理员帐号登陆了(本人操做的时候,)spa

至此gitlab告一段落。后续记录接入LDAP.net

 

参考文档rest

https://www.jianshu.com/p/808fbf9d972f

https://blog.csdn.net/hnmpf/article/details/80518460

相关文章
相关标签/搜索