Linux 搭建私服Gitlab
Gitlab官网
一. 获取yum源
-
访问清华大学镜像站
-
搜索gitlab-ce

-
找寻适合的版本
点击yum目录
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-SD8zPXrE-1657948037642)(Linux 搭建私服Gitlab.assets/image-20220716124025687.png)]](https://i-blog.csdnimg.cn/blog_migrate/4b05b041de2b45a61c2a49ba29c97f19.png)
点击el7
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Cg6I6Nqn-1657948037643)(Linux 搭建私服Gitlab.assets/image-20220716124207957.png)]](https://i-blog.csdnimg.cn/blog_migrate/d60fd41467373c5edb759b39c4e7a2ec.png)
选择适合自己的版本下载
ps:也可直接把该网址写成yum源(本人采用这种)

二. 配置repo文件
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost ~]# vim gitlab.repo
[gitlab]
# 名称
name=gitlab-ce
# 源地址
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
# 开启
enabled=1
# 内部软件安装gbgcheck关闭即可
gpgcheck=0
三. 安装
由于gitlab将近1个G,下载时间会很长
[root@localhost ~]# yum -y install gitlab-ce
四. 配置访问地址
ip:服务器ip
port:访问端口
[root@localhost ~]# vim /etc/gitlab/gitlab.rb
# extenal_url 'http://ip:port'
五. 启动
- 重新加载配置
- 重启gitlab
[root@localhost ~]# gitlab-ctl reconfigure
[root@localhost ~]# gitlab-ctl restart
六.访问
- ⭐️获取账号密码
登录账号默认为:root
密码通过文件查询获取
[root@localhost ~]# cat /etc/gitlab/initial_root_password ....... Password: 32ADmL2uChmwsBYIBFfPSwA2uyALCbmok3RSofidUUo=
-
⭐️访问
访问地址 -> http://ip:port
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-z3qwAz9s-1657948037644)(Linux 搭建私服Gitlab.assets/image-20220716125838345.png)]](https://i-blog.csdnimg.cn/blog_migrate/21042b31e57f543884150404b0373ee5.png)
七. 常用命令
停止运行
# gitlab-ctl stop
启动
# gitlab-ctl start
重启
# gitlab-ctl restart
重新加载配置
# gitlab-ctl reconfigure
查看状态
# gitlab-ctl status
本文详细介绍了如何在Linux上通过YUM源安装并配置GitLab,包括获取清华镜像源、配置repo文件、安装、设置外部访问地址,以及常用命令操作。
237

被折叠的 条评论
为什么被折叠?



