参考链接
bilibili地址
https://git-scm.com/book/en/v2/Git-on-the-Server-GitLab
安装步骤:
关闭selinux
vi /etc/sysconfig/selinux;设置SELINUX=disabled;重启服务器;
临时关闭setenforce 0 ;getenforce查看selinux状态
安装依赖
yum方式安装
yum install -y curl policycoreutils-python openssh-server perl
rpm方式安装
可能在公司内部服务器上,没有外网和内部yum源,需要使用rpm方式安装。
下载依赖包
找一台个人电脑,配置centos7/8仓库:下载http://mirrors.aliyun.com/repo/Centos-7.repo;将/etc/yum.repos.d备份并清空。
清楚yum缓存:yum clean all
安装dnf:yum -y install dnf
下载依赖:dnf download --resolve --alldeps curl
dnf download --resolve --alldeps policycoreutils-python
dnf download --resolve --alldeps openssh-server
dnf download --resolve --alldeps perl
安装依赖
rpm -ivh --upgrade 对应rpm包名
过程中可能有依赖冲突问题,参考下文“问题分析”解决。
安装并登录gitlab
下载gitlab镜像
下载地址https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
安装gitlab
rpm -ivh rpm包名
配置gitlab
修改/etc/gitlab/gitlab.rb文件 external_url 'http://127.0.0.1:8080'
gitlab-ctl reconfigure
chmod -R 755 /var/log/gitlab
gitlab-ctl restart
登录
重启完后,在 /etc/gitlab/initial_root_password 获取root用户密码。
登录地址为external_url地址,登录后需要及时修改密码。
问题分析
依赖冲突问题
安装过程中,会出现找不到依赖问题,可以在阿里云镜像和centos镜像仓库查到依赖。
https://developer.aliyun.com/mirror/
https://centos.pkgs.org/
登录超时问题
可能因为端口冲突或者内存不足导致超时