本文介绍如何在CentOS7.2上搭建Gitlab服务器,并简单介绍如何使用。

Preface

  使用的是CentOS7.2的操作系统,安装当前最新版Gitlab服务器,下载地址:清华大学开源软件镜像站

gitlab-ce-12.0.-ce..el7.x86_64.rpm    610.5 MiB    -- :

  下载软件包。

# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
# git --version
git version 1.8.3.1
# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.0.2-ce.0.el7.x86_64.rpm
# ls
gitlab-ce-12.0.2-ce.0.el7.x86_64.rpm

安装依赖

  gitlab依赖policycoreutils-python,需要先安装相关依赖。

# yum install -y policycoreutils-python

安装Gitlab服务器

  使用rpm -i 可直接安装相关软件包。

# rpm -i gitlab-ce-12.0.-ce..el7.x86_64.rpm
warning: gitlab-ce-12.0.-ce..el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
It looks like GitLab has not been configured yet; skipping the upgrade script. *. *.
*** ***
***** *****
.****** *******
******** ********
,,,,,,,,,***********,,,,,,,,,
,,,,,,,,,,,*********,,,,,,,,,,,
.,,,,,,,,,,,*******,,,,,,,,,,,,
,,,,,,,,,*****,,,,,,,,,.
,,,,,,,****,,,,,,
.,,,***,,,,
,*,. _______ __ __ __
/ ____(_) /_/ / ____ _/ /_
/ / __/ / __/ / / __ `/ __ \
/ /_/ / / /_/ /___/ /_/ / /_/ /
\____/_/\__/_____/\__,_/_.___/ Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
sudo gitlab-ctl reconfigure For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

  gitlab默认占用8080端口,因为我们这是临时测试使用,为了不被错杀,建议修改为其它非Web-like端口,如10101等其它端口。

修改端口

  修改gitlab配置文件。

# vim /etc/gitlab/gitlab.rb
...
external_url 'http://xx.xx.xx.xx:10101' # ip:port的形式

重新配置

  修改配置文件之后,需重新配置,执行如下命令。

# gitlab-ctl reconfigure
...
Running handlers:
Running handlers complete
Chef Client finished, / resources updated in seconds
gitlab Reconfigured!

启动服务

  配置完成之后,启动服务。

# gitlab-ctl restart
ok: run: alertmanager: (pid 3687) 0s
ok: run: gitaly: (pid 3697) 0s
ok: run: gitlab-monitor: (pid 3714) 0s
ok: run: gitlab-workhorse: (pid 3716) 1s
ok: run: grafana: (pid 3723) 0s
ok: run: logrotate: (pid 3742) 1s
ok: run: nginx: (pid 3750) 0s
ok: run: node-exporter: (pid 3756) 1s
ok: run: postgres-exporter: (pid 3765) 0s
ok: run: postgresql: (pid 3774) 1s
ok: run: prometheus: (pid 3777) 0s
ok: run: redis: (pid 3792) 0s
ok: run: redis-exporter: (pid 3816) 0s
ok: run: sidekiq: (pid 3904) 0s
ok: run: unicorn: (pid 3915) 0s

访问界面

  访问刚才在配置文件中设置的http://xx.xx.xx.xx:10101

设置管理员密码

  如下界面,设置管理员密码。

  可以选择登录或注册,使用root和刚才设置的管理员口令进行登录。

     目前空空如也。

  可以创建项目、组、添加用户和进行相关配置,这样Gitlab服务器便安装完成。

CentOS7 搭建gitlab服务器的更多相关文章

  1. Centos7 搭建Gitlab服务器并配置项目全过程

    https://blog.csdn.net/Abysscarry/article/details/79402695 gitlab与jenkins整合搭建      https://blog.csdn. ...

  2. centos7搭建Gitlab服务器

    虚拟机配置信息 内存最好大于或等于4G,之前用2G内存搭建,访问出现502报错信息 不考虑selinux和防火墙问题 搭建之前最好关掉selinux和防火墙 临时调增selinux和关闭防火墙 下载G ...

  3. centos7搭建gitlab服务器、汉化

    1.下载rpm安装包 https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-8.8.5-ce.1.el7.x86_64.rp ...

  4. Centos7使用docker搭建gitlab服务器

    了解到docker的优点,搭建快,运行要求资源低,最重要的是实现的功能和效果都能达到预期,于是决定使用docker来搭建gitlab服务器. 效果图如下: 系统环境:CentOS Linux rele ...

  5. 搭建GitLab服务器

    前言 每一个开发工作者无非身处2中开发环境:1.开源环境  2.闭源开发环境,若你身处闭源环境或对自己代码安全性要求较高,搭建和使用自己GitLab服务器是必不可少的环节. 可以通过各种方式搭建自己的 ...

  6. Linux系统搭建GitLab---阿里云Centos7搭建Gitlab踩坑

    一.简介 GitLab,是一个利用 Ruby on Rails 开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目安装. 它拥有与GitHub类似的功能,能 ...

  7. Ubuntu搭建Gitlab服务器

    想到Gitlab就必定会想到SVN,因为两者都是代码管理系统,作为开发人员来说,用习惯了SVN的图形化界面和SVN代码更新和提交的方式, 可能就会觉得使用git会比较麻烦,其实不然git使用起来非常方 ...

  8. CentOS7 搭建 SVN 服务器

    CentOS7 搭建 SVN 服务器 介绍SVN: SVN是Subversion的简称,是一个开放源代码的版本控制系统,相较于RCS.CVS,它采用了分支管理系统,它的设计目标就是取代CVS.互联网上 ...

  9. centos7 搭建WEB服务器

    centos7 搭建WEB服务器 2017年09月17日 09:44:50 逝然1994 阅读数:18321 标签: centosapacheweb服务器 更多 个人分类: centos服务器简单配置 ...

随机推荐

  1. Oracle 如何删除掉一个用户下的所有对象

    create or replace procedure drop_all as cursor cur_obj is select uo.OBJECT_NAME, uo.OBJECT_TYPE from ...

  2. 重构qDebug()<<,使log输出到文件

    重构qDebug()<<,使log输出到文件 #include <QProcessEnvironment> #include <QDateTime> #includ ...

  3. 细数 Windows Phone 灭亡的七宗罪(过程很详细,评论很精彩,但主要还是因为太慢了,生态跟不上,太贪了,厂商不愿意推广)

    曾梦想仗剑走天涯,看一看世界的繁华 年少的心有些轻狂,如今你四海为家 曾让你心疼的姑娘,如今已悄然无踪影 犹记得上大学攒钱买了第一台智能手机Lumia 520时,下载的第一首歌曲<曾经的你> ...

  4. spring boot mybatis XML文件读取properties配置信息

    配置文件application.properties中相关配置信息可以在部署以后修改,引用配置信息可以在代码和mybatis的映射文件中 1.JAVA代码 可以通过变量去读取 application. ...

  5. WPF异常捕获,并使程序不崩溃!

    原文:WPF异常捕获,并使程序不崩溃! 在.NET中,我们使用try-catch-finally来处理异常.但,当一个Exception抛出,抛出Exception的代码又没有被try包围时,程序就崩 ...

  6. 【C#】wpf添加gif动图支持

    原文:[C#]wpf添加gif动图支持 1.nuget里下载XamlAnimatedGif包,然后安装. 2.添加XamlAnimatedGif包的命名空间:xmlns:gif="https ...

  7. delphi dom动态创建节点方法

    在一次测试demo中 需要动态的创建xml节点并添加,实现方法如下: var NewItem:IXMLDOMElement; NewItem:=ConfigDoc.createElement('ite ...

  8. axure跨inframe传递参数

    在global variable添加loginuser变量 在link to and external url or file添加如下:[[Item.action]]#loginuser=[[logi ...

  9. 可以用GetObjectProp来获取对象的属性

    原来可以用GetObjectProp来获取对象的属性,还有这用法,哈哈哈哈…… var SL: TStrings; UseDBTools: Boolean;begin SL := nil; if Me ...

  10. OpenGL与Directx的区别

    OpenGL 只是图形函数库. DirectX 包含图形, 声音, 输入, 网络等模块. 单就图形而论, DirectX 的图形库性能不如 OpenGL OpenGL稳定,可跨平台使用.但 OpenG ...