手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

快速学会CentOS配置GitLab

[日期:2018-08-05] 来源:Linux社区  作者:wuyongcong [字体: ]

下载GitLab

亲测: CentOS 6.5 

安装依赖包:

yum install curl policycoreutils policycoreutils-Python openssh-server openssh-clients

依赖包安装完成之后:

1: systemctl enable sshd
2: systemctl start sshd
3: yum install postfix
4: systemctl enable postfix
5: systemctl start postfix
6: firewall-cmd --permanent --add-service=http
7: systemctl reload firewalld

以上依赖安装完之后,下载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包

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/gitlab-ce-8.0.0-ce.0.el6.x86_64.rpm

安装rpm包

rpm -i gitlab-ce-8.0.0-ce.0.el6.x86_64.rpm

安装完成之后

vim /etc/gitlab/gitlab.rb

修改gitlab配置文件,访问IP:端口,  如果不修改默认80端口,进入文件之后,找到

external_url      #  这个变量

修改external_url变量

external_url 'http://ip:端口'

修改完成之后退出并且保存

esc    +  wq

保存之后需要更新一下修改

gitlab-ctl reconfigure

重启gitlab

gitlab-ctl restart      # 重启

gitlab-ctl stop        #  停止

gitlab-ctl start        # 启动

gitlab-ctl status      # 查看状态

访问gitlab

输入你在  /etc/gitlab/gitlab.rb文件里定义的
external_url后边跟的ip就可以访问

配置成功之后就会出现这个页面,  默认账号:root, 密码;password,  如果不对的话,请自行修改。

修改gitlab管理员账号密码

gitlab-rails console production

# 按下回车之后会出现
Loading production environment (Rails 4.1.1)

# 依次输入
irb(main):001:0> user = User.where(id:1).first
irb(main):002:0> user.password='66668888'      # root密码
irb(main):003:0> user.save!

# 返回
true        # 表示修改成功

Ctrl+C 可以退出了

到了这里之后,gitlab就配置完成了,接下来就可以使用了。以上所有方法,亲测,全部有效。

# 修改gitlab  IP地址

vim /etc/gitlab/gitlab.rb

external_url 'ip地址'

配置完成
重置命令:    gitlab-ctl reconfigure

重启命令:    gitlab-ctl restart

更多GitLab相关教程见以下内容

CentOS7安装GitLab、汉化及使用  https://www.linuxidc.com/Linux/2017-11/148223.htm
CentOS 7安装部署GitLab服务器  https://www.linuxidc.com/Linux/2017-06/144990.htm
CentOS 7.x上GitLab搭建详细教程  https://www.linuxidc.com/Linux/2017-12/149766.htm
CentOS 7安装部署GitLab服务器  https://www.linuxidc.com/Linux/2017-06/144990.htm
CentOS 7使用Docker搭建GitLab服务器  https://www.linuxidc.com/Linux/2018-04/151725.htm
Ubuntu 16.04搭建GitLab服务器 https://www.linuxidc.com/Linux/2018-01/150319.htm

GitLab 的详细介绍请点这里
GitLab 的下载地址请点这里 

Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx

本文永久更新链接地址https://www.linuxidc.com/Linux/2018-08/153345.htm

linux
相关资讯       配置GitLab 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款