GitLab是Git的基于WEB的图形化管理平台,提供Git的用户、权限等高级管理功能。

运行环境

系统版本:CentOS Linux release 7.3.1611 (Core)

软件版本:Gitlab-ce-11.10.1

硬件要求:最低2核4GB,建议4核8GB

安装过程

1、安装依赖

[root@localhost ~]# yum -y install curl policycoreutils-python openssh-server

2、配置系统环境

[root@localhost ~]# systemctl enable sshd                                                 => 设置SSH远程服务开机自启
[root@localhost ~]# systemctl start sshd => 启动SSH远程服务
[root@localhost ~]# systemctl stop firewalld => 停止Firewalld防火墙服务
[root@localhost ~]# systemctl disable firewalld => 禁用Firwalld防火墙服务开机自启
[root@localhost ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux => 关闭SeLinux(重启主机生效)
[root@localhost ~]# setenforce 0 => 关闭SeLinux(当前生效)

3、添加YUM-Gitlab源

我们使用清华大学提供的YUM源,以提高下载速度。

[root@localhost ~]# vim /etc/yum.repos.d/gitlab-ce.repo
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1
[root@localhost ~]# yum makecache

4、安装Gitlab

我们选择安装最新版本的Gitlab。

[root@localhost ~]# yum install -y gitlab-ce
可以访问"https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/"查看Gitlab-ce的版本。
安装历史版本请使用下面命令:
[root@localhost ~]# yum install -y gitlab-ce-{VERSION}

5、配置Gitlab

建议使用HTTPS。

[root@localhost ~]# vim /etc/gitlab/gitlab.rb
### 基础配置 ###
external_url 'https://gitlab.xxx.cn'
#用户访问所使用的URL,域名或者IP地址
gitlab_rails['time_zone'] = 'Asia/Shanghai'
#时区 ### SSH配置 ###
gitlab_rails['gitlab_shell_ssh_port'] = 10222
#使用SSH协议拉取代码所使用的连接端口。 ### 邮箱配置 ###
gitlab_rails['smtp_enable'] = true
#启用SMTP邮箱功能,绑定一个第三方邮箱,用于邮件发送
gitlab_rails['smtp_address'] = "smtp.exmail.qq.com"
#设置SMTP服务器地址
gitlab_rails['smtp_port'] = 465
#设置SMTP服务器端口
gitlab_rails['smtp_user_name'] = "xxx@xxx.cn"
#设置邮箱账号
gitlab_rails['smtp_password'] = "xxx"
#设置邮箱密码
gitlab_rails['smtp_authentication'] = "login"
#设置邮箱账号密码身份验证方式,"login"表示采用账号密码的方式登陆
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
#设置开启SMTP邮件使用TLS传输加密协议传输邮件,以保证邮件安全传输
gitlab_rails['gitlab_email_from'] = 'xxx@xxx.cn'
#设置Gitlab来源邮箱地址,设置登陆所使用的邮箱地址 ### WEB配置 ###
nginx['enable'] = true
#启用Nginx服务
nginx['client_max_body_size'] = '250m'
#设置客户端最大文件上传大小
nginx['redirect_http_to_https'] = true
#设置开启自动将HTTP跳转到HTTPS
nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.xxx.cn.pem"
#设置HTTPS所使用的证书
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.xxx.cn.key"
#设置HTTPS所使用的证书密码
nginx['ssl_protocols'] = "TLSv1.1 TLSv1.2"
#设置HTTPS所使用的TLS协议版本
nginx['ssl_session_cache'] = "builtin:1000 shared:SSL:10m"
#设置开启SSL会话缓存功能
nginx['ssl_session_timeout'] = "5m"
#设置SSL会话超时时间
nginx['listen_addresses'] = ['*', '[::]']
#设置Nginx监听地址,"*"表示监听主机上所有网卡的地址
nginx['gzip_enabled'] = true
#设置开启Nginx的传输压缩功能,以节约传输带宽,提高传输效率

6、上传SSL证书到指定目录

[root@localhost ~]# ll /etc/gitlab/ssl/
total 28
drwxr-xr-x 2 root root 4096 Apr 25 11:48 ./
drwxrwxr-x 4 root root 4096 Apr 25 12:50 ../
-rw-r--r-- 1 root root 1675 Apr 25 11:45 gitlab.xxx.cn.key
-rw-r--r-- 1 root root 3671 Apr 25 11:45 gitlab.xxx.cn.pem

7、刷新配置

当配置文件发生变化时,或者是第一次启动时,我们需要刷新配置。
[root@localhost ~]# systemctl restart gitlab-runsvdir
[root@localhost ~]# gitlab-ctl reconfigure

8、启动服务

[root@localhost ~]# gitlab-ctl restart
[root@localhost ~]# gitlab-ctl status
run: alertmanager: (pid 13541) 2171s; run: log: (pid 13221) 2192s
run: gitaly: (pid 13557) 2170s; run: log: (pid 12463) 2266s
run: gitlab-monitor: (pid 13580) 2169s; run: log: (pid 13103) 2208s
run: gitlab-workhorse: (pid 13602) 2169s; run: log: (pid 12887) 2226s
run: logrotate: (pid 13617) 2168s; run: log: (pid 12959) 2218s
run: nginx: (pid 13628) 2168s; run: log: (pid 12927) 2222s
run: node-exporter: (pid 13714) 2168s; run: log: (pid 13002) 2214s
run: postgres-exporter: (pid 13720) 2167s; run: log: (pid 13270) 2188s
run: postgresql: (pid 13740) 2167s; run: log: (pid 12669) 2258s
run: prometheus: (pid 13748) 2166s; run: log: (pid 13181) 2198s
run: redis: (pid 13761) 2166s; run: log: (pid 11907) 2293s
run: redis-exporter: (pid 13800) 2165s; run: log: (pid 13143) 2202s
run: sidekiq: (pid 13821) 2163s; run: log: (pid 12872) 2227s
run: unicorn: (pid 13833) 2162s; run: log: (pid 12832) 2233s

9、测试邮件发送

我们在启动完成后测试一下邮件发送功能是否正常工作。

[root@localhost ~]# gitlab-rails console
irb(main):001:0> Notify.test_email('邮箱地址', '标题', '内容').deliver_now
irb(main):002:0> exit

10、第一次访问登陆

第一次需要输入新的超级管理员(root)密码。

修改成功后,我们使用超级管理员用户“root”账号登录Gitlab管理平台。



11、关闭用户注册功能

为了避免用户随便注册账号,我们将注册功能关闭。



11、设置语言为"简体中文"

保存后重启登陆即可。

安装Gitlab到CentOS(YUM)的更多相关文章

  1. Ejabberd2:安装和操作指南(centos yum 安装ejabberd)

    (1)首先安装EPEL Repository     ## RHEL/CentOS 6 32-Bit ##  # wget http://download.fedoraproject.org/pub/ ...

  2. centos6/7安装gitlab

    CentOS/RHEL 6/7安装gitlab新建 /etc/yum.repos.d/gitlab-ce.repo,内容为你的CentOS/RHEL版本:centos6 [gitlab-ce] nam ...

  3. CentOS7下安装Gitlab社区版【安装步骤、IP改域名、修改端口】

    这两天一直在给公司的服务器配置Gitlab(10.5.4).过程很是痛苦,所以把过程记录一下. 1.安装CentOS7 从官网上下载了最新版CentOS-7-x86_64-DVD-1708.iso.用 ...

  4. centos7安装gitlab并汉化

    一.基础环境准备 1.安装依赖包 [root@gitlab-server ~]#yum install curl policycoreutils openssh-server openssh-clie ...

  5. CentOS安装gitlab,gerrit,jenkins并配置ci流程

    CentOS安装gitlab,gerrit,jenkins并配置ci流程 By Wenbin juandx@163.com 2016/4/9 这是我参考了网上很多的文档,配置了这三个软件在一个机器上, ...

  6. CentOS安装gitLab服务器

    首先利用gitlab-install-el6.sh安装,比较简单: (出处:http://www.linuxidc.com/Linux/2013-06/85754.htm) 1:如果有条件,提供一台全 ...

  7. centos 6.5安装GitLab全过程和问题记录

    GitLab,是一个使用 Ruby on Rails 开发的开源应用程序,与Github类似,能够浏览源代码,管理缺陷和注释,非常适合在团队内部使用. 官方只提供了Debian/Ubuntu系统下的安 ...

  8. centos 7.4 安装gitlab

    centos 7.4 安装gitlab #curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/scrip ...

  9. CentOS 7 安装GitLab

    CentOS 安装GitLab CentOS 安装GitLab GitLab是一个利用Ruby on Rails开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私 ...

随机推荐

  1. js中 call() 和 apply() 方法的区别和用法详解

    1.定义 每个函数都包含俩个非继承而来的方法:call() 和 apply()   call 和 apply 可以用来重新定义函数的的执行环境,也就是 this 的指向:call 和 apply 都是 ...

  2. 【原创】在 ASP.NET Core 3.1 中使用 Senparc.Weixin.Work 企业微信 SDK —— 发送文本消息

    下面在 Web 空应用里展示一个简单的例子来实现发送文本消息. 本文目录: 创建 Web 空应用 命令行方式创建 添加SDK引用 命令行方式 进入项目目录 添加包引用 配置和使用SDK 添加appse ...

  3. openstack 架构

    openstack 概念架构: openstack逻辑架构 常见的架构:

  4. 使用npm发布、查看、引用、删除自己的包[小白推荐]

    前言  怎么使用npm发布自己的组件包呢?博主看了不少相关的文章,都没有一个好的讲述.要么丢三落四,要么就是复杂到外行人根本看不懂,甚至无从下手.于是,在博主的潜心钻研下,终于成功了!所以,我打算写一 ...

  5. 使用CStatic显示图片(bmp、ico、png)

    一.显示bmp及ico //h文件 CStatic m_static; //cpp文件 CBitmap bitmap; bitmap.LoadBitmapW(IDB_BITMAP); //加载位图 B ...

  6. 几个点认识Nginx服务器

    Nginx 其实就是一款轻量级的 Web 服务器.反向代理服务器,由于它的内存占用少,启动极快,高并发能力强,在互联网项目中广泛应用. 那么你可能会问了:“不是说 Nginx 吗?怎么又扯出来一个 W ...

  7. 一键安装php5.6.40脚本(LAMP环境)

    #!/bin/bash #安装依赖软件 yum -y install libxml2-devel curl-devel libjpeg libjpeg-devel libpng libpng-deve ...

  8. MySQL索引那些事

    原文链接 大家有没有遇到过慢查询的情况,执行一条SQL需要几秒,甚至十几.几十秒的时间,这时候DBA就会建议你去把查询的 SQL 优化一下,怎么优化?你能想到的就是加索引吧? 为什么加索引就查的快了? ...

  9. Literature Review: Improving Image-Based Localization by Active Correspondence Search

    Abstract Input: A query image Source: A point cloud reconstruction of a large scene (有一百多万3D点) Resul ...

  10. OpenCV图像变换二 投影变换与极坐标变换实现圆形图像修正

    投影变换 在放射变换中,物体是在二维空间中变换的.如果物体在三维空间中发生了旋转,那么这种变换就成为投影变换,在投影变换中就会出现阴影或者遮挡,我们可以运用二维投影对三维投影变换进行模块化,来处理阴影 ...