本文软件安装版本
OS: viritualBox CentOS 7.4虚机
GitLab: gitlab-ee-10.6.2-ee.0.el7.x86_64
用户:root用户
1.gitlab官方网站
https://about.gitlab.com/installation/#centos-7
2. 先更新源
#先更新yum 源,这里安装的是阿里的源
[root@localhost ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.back
#获取最新源
[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
#更新
[root@localhost ~]# yum update
3.安装前的配置
[root@localhost ~]# yum install -y curl policycoreutils-python openssh-server
[root@localhost ~]# systemctl enable sshd
[root@localhost ~]# systemctl start sshd
[root@localhost ~]# firewall-cmd --permanent --add-service=http
[root@localhost ~]# systemctl reload firewalld
4.安装gitlab
# add the gitlab package repository
[root@localhost ~]# curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
# EXTERNAL_URL="http://192.168.1.100:8088" 这里写你的IP和port
[root@localhost ~]# EXTERNAL_URL="http://192.168.1.100:8088" yum install -y gitlab-ee
如果非常慢,可以用迅雷等下载gitlab的安装包,然后通过sftp的方式传到服务器上安装。
迅雷下载的地址:gitlab10.6.2 rpm包地址
gitlab下载地址:包下载地址
#切换到sftp上传的包目录
[root@localhost ~]# cd /home
[root@localhost ~]# ls
gitlab-ee-10.6.2-ee.0.el7.x86_64.rpm
[root@localhost ~]# EXTERNAL_URL="http://192.168.1.100:8088" rpm -i gitlab-ee-10.6.2-ee.0.el7.x86_64.rpm
这个安装的过程好像很慢,我2G内存的情况下,在gitlab-ee安装完成后,卡那了。
过了一大会,查看/opt
目录下有了gitlab的目录,在/etc
目录下也有了gitlab的目录。
网页访问http://192.168.1.100:8088也返回被拒绝,查看官网要求是4G内存最低,所以关闭虚机,内存调整为4G在启动起操作系统来看,发现可以访问http://192.168.1.100:8088了,直接重定向到了第一次登录时,让重置root密码。
重置root密码页面
设定root密码后跳转到登录页