Linux离线部署gitLab及使用教程

一、下载gitLab

下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/

找到最新版本

 点击下载

二、上传到Linux系统上

使用Xftp把下载的gitLab安装包上传到linux系统上,本人是放在根目录的opt文件夹下,可以根据实际需要调整。

 

三、安装gitLab

在安装之前,有两个依赖需要检查下 openssh-server 和 policycoreutils-python

检查命令如下:

rpm -qa | grep -i openssh-server
rpm -qa | grep -i policycoreutils-python

如果你输入命令回车后,没有返回对应的信息,那需要单独下载依赖了。本人没有安装policycoreutils-python:

在阿里巴巴开源镜像网站(https://developer.aliyun.com/packageSearch)下载。(https://blog.csdn.net/qq_32596527/article/details/107113487)

 本地安装:policycoreutils-python

yum -y localinstall policycoreutils-python-2.5-34.el7.x86_64.rpm

 再次检查policycoreutils-python

rpm -qa | grep policycoreutils-python

 如果还是失败请参考https://blog.csdn.net/qq_32596527/article/details/107113487。安装!

接着执行安装gitLab命令:

yum -y localinstall gitlab-ce-16.9.2-ce.0.e17.x86_64.rpm

 

 四、修改IP和Port端口

vi /etc/gitlab/gitlab.rb

 最好写成localhost,万一服务器Ip修改了,还需要配置,当然写成固定的IP地址也没毛病!

 改好后,按下Esc键,输入:wq 回车保存即可。

 五、重新加载配置文件

gitlab-ctl reconfigure

此过程比较长,耐心等待,中途不要操作

出现 gitlab Reconfigured! 即操作成功。

六、查看用户名和密码

 /etc/gitlab/initial_root_password是初始化密码的临时存放地,并且在第一次重新加载配置 gitlab-ctl reconfigure 24小时后会被清理。

通过命令修改:

vi /etc/gitlab/initial_root_password

 

 七、访问gitLab

 发现无法访问,查看防火墙状态

systemctl status firewalld

 

 开放10005端口

sudo firewall-cmd --permanent --add-port=10005/tcp

 

 重载防火墙

sudo firewall-cmd --reload

 

 登录账号为root,密码为在etc/initial_root_password中的密码。

启动/关闭GitLab:

//启动

sudo gitlab-ctl start

//关闭

sudo gitlab-ctl stop

//查看状态

sudo gitlab-ctl status

 使用教程参考:

http://dba.qishuo.xin/?p=3638

https://blog.csdn.net/matrixlzp/article/details/130774387

 

参考地址:

https://blog.csdn.net/weixin_40141628/article/details/136906209

https://blog.csdn.net/Hemameba/article/details/133308889

https://blog.csdn.net/qq_32596527/article/details/107113487

posted @ 2024-04-03 16:02  创客未来  阅读(321)  评论(0编辑  收藏  举报