centos7安装GitLab最新版本

一、安装gitlab

1、依赖包安装

[root@svn_git ~]# yum install curl policycoreutils-python openssh-server postfix wget git patch -y

启动ssh和postfix服务、关闭防火墙,创建服务用户gitlab

[root@svn_git ~]# useradd -s /sbin/nologin gitlab
[root@svn_git ~]# systemctl start sshd
[root@svn_git ~]# systemctl enable sshd
[root@svn_git ~]# systemctl start postfix
[root@svn_git ~]# systemctl enable postfix
[root@svn_git ~]# systemctl stop firewalld
[root@svn_git ~]# systemctl disable firewalld
[root@svn_git ~]# setenforce 0
[root@svn_git ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

2、GitLab包下载

[root@svn_git ~]# wget https://mirror.tuna.tsinghua.edu.cn/gitlab-ee/yum/el7/gitlab-ee-13.0.6-ee.0.el7.x86_64.rpm

3、安装

[root@svn_git ~]# yum install gitlab-ee-13.0.6-ee.0.el7.x86_64.rpm -y

4、配置配置文件

[root@svn_git ~]# vim /etc/gitlab/gitlab.rb 
//修改29行为自己域名,777和778行为服务用户名和组
  29 external_url 'http://gitlab.cnbugs.com'
 777 user['username'] = "gitlab"
 778 user['group'] = "gitlab"

5、加载GitLab资源

[root@svn_git ~]# gitlab-ctl reconfigure

查看服务

6、打开浏览器访问设置的域名(外网需要做域名解析,内网需要增加hosts文件),用户名默认为root,密码为自己设置的密码

安装完成

发表评论

后才能评论