Gitlab安装部署

安装依赖软件

10.x以后开始依赖policycoreutils-python,我之前在使用9.x时还没有依赖该项 升级时会提示 rpm -Uvh gitlab-ce-10.1.0-ce.0.el7.x86_64.rpm...

[root@linux-node1 ~]# yum -y install policycoreutils openssh-server openssh-clients postfix policycoreutils-python

设置postfix开机自启,并启动,postfix支持gitlab发信功能

[root@linux-node1 ~]# systemctl enable postfix && systemctl start postfix

下载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

下载rpm包并安装:

[root@linux-node1 ~]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.2.3-ce.0.el7.x86_64.rpm
[root@linux-node1 ~]# rpm -ivf gitlab-ce-11.2.3-ce.0.el7.x86_64.rpm

修改gitlab配置文件指定服务器ip和自定义端口

[root@linux-node1 ~]# vim /etc/gitlab/gitlab.rb

external_url 'http://192.168.1.80'
unicorn['port'] = 8890

重置并启动GitLab

[root@linux-node1 ~]# gitlab-ctl reconfigure #重新配置

关闭gitlab:

[root@linux-node1 ~]# gitlab-ctl stop

启动gitlab:

[root@linux-node1 ~]# gitlab-ctl start

重启gitlab:

[root@linux-node1 ~]# gitlab-ctl restart

访问 GitLab页面

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

a、 切换目录:cd /opt/gitlab/bin

b、执行 :sudo gitlab-rails console production 命令 开始初始化密码

c、在irb(main):001:0> 后面通过 u=User.where(id:1).first 来查找与切换账号(User.all 可以查看所有用户)

d、通过u.password='12345678'设置密码为12345678(这里的密码看自己喜欢):

e、通过u.password_confirmation='12345678' 再次确认密码

f、通过 u.save!进行保存(切记切记 后面的 !)

g、如果看到上面截图中的true ,恭喜你已经成功了,执行 exit 退出当前设置流程即可。

h、回到gitlab ,可以通过 root/12345678 这一超级管理员账号登录了

修改GitLab页面链接

vim /var/opt/gitlab/gitlab-rails/etc/gitlab.yml

8ac3a62d3b6f6c07816d31e067dd00e7f18.jpg

 

 

转载于:https://my.oschina.net/u/204616/blog/1982459

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值