liunx搭建gitlab代码管理

1.使用centOS7

2.安装相关依赖

yum -y install policycoreutils openssh-server openssh-clients postfix

3.启动ssh服务&设置为开机启动

systemctl enable sshd && sudo systemctl start sshd 或

systemctl start sshd 

systemctl enable sshd

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

systemctl enable postfix && systemctl start postfix

5.开放ssh以及http服务,然后重新加载防火墙列表

firewall-cmd --add-service==ssh --permanent

firewall-cmd --add-service==http --permanent

firewall-cmd --reload

如果防火墙直接关闭就不需要以上配置

6.下载gitlab包,并且安装

6.1查看安装包下载地址,选择合适的版本

https://mirrors.tuna.tsinghua.edu.cn

6.2查找对应版本软件

 

 

 

 6.3下载安装包

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-15.11.9-ce.0.el7.x86_64.rpm --no-check-certificate

6.4安装

rpm -i gitlab-ce-15.11.9-ce.0.el7.x86_64.rpm

7.修改gitlab配置

vim /ect/gitlab/gitlab.rb

修改gitlab访问地址和端口,默认为80,改为8082

external_url'http://192.168.64.128:8082'

防止后序有502错误出现,修改以下

nginx['listen_port']=8082

8.重载配置及启动gitlab

gitlab-ctl reconfigure

gitlab-ctl restart

9.把端口添加到防火墙

firewall-cmd --zone=public --add-port=8082/tcp --permanent

firewall-cmd --reload

启动成功后,看到修改管理员root密码的页面,修改密码后,然后登录即可

如登录后只有登录页面,可以执行以下方法进行修改

进入控制台

gitlab-rails console -e production

查询id为1的用,id为1的用户是超级管理员

user = User.where(id:1).first

修改密码为******

user.password='*****'

保存

user.save!

退出

exit

10.gitlab使用命令

查看服务状态:gitlab-ctl status

查看数据库状态:gitlab-rake db:migrate:status

升级数据库: gitlab-rake db:migrate

再加载:gitlab-ctl reconfigure


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值