前言

Git作为后起之秀,在版本控制领域占据了头把交椅。Github作为托管式的代码仓库,从代码安全性和网络传输等各个方面考虑,对于个人和公司来讲,具有一定的局限性。Gitlab提供的不同版本的安装包,可以实现私有的Git服务器搭建。

版本

Gitlab提供了Community Edition、Enterprise Edition Starter、Enterprise Edition Premium等不同版本的安装包。由于免费的关系,我们使用Community Edition版本进行学习。该版本有bitnami和GitLab CE Omnibus package两种安装包。
百度网盘地址:
https://pan.baidu.com/s/1PTrFAs4hxol1RExNrNYlzg
Gitlab官网下载地址:
https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-8.15.3-ce.0.el7.x86_64.rpm
bitnami下载地址:
https://bitnami.com/stack/gitlab/installer
由于天朝的原因,从gitlab.com中下载rpm文件比较慢。
附上清华镜像地址:
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/

环境

CentOS7.2(VMware10)(CentOS-7-x86_64-DVD-1611.iso)

Gitlab8.15(gitlab-ce-8.15.3-ce.0.el7.x86_64.rpm)

Git2.11(git-2.11.0.tar.gz)

官方教程

  1. Install and configure the necessary dependencies
    If you install Postfix to send email please select 'Internet Site' during setup. Instead of using Postfix you can also use Sendmail or configure a custom SMTP server and configure it as an SMTP server.
    On Centos 6 and 7, the commands below will also open HTTP and SSH access in the system firewall.
    sudo yum install curl policycoreutils openssh-server openssh-clients
    sudo systemctl enable sshd
    sudo systemctl start sshd
    sudo yum install postfix
    sudo systemctl enable postfix
    sudo systemctl start postfix
    sudo firewall-cmd --permanent --add-service=http
    sudo systemctl reload firewalld
  2. Add the GitLab package server and install the package
    curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
    sudo yum install gitlab-ce

    If you are not comfortable installing the repository through a piped script, you can find the entire script here and select and download the package manually and install using
    curl -LJO https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-XXX.rpm/download
    rpm -i gitlab-ce-XXX.rpm
  3. Configure and start GitLab
    sudo gitlab-ctl reconfigure

    如果以上提示缺少semanage模块
    请运行下面的命令安装selinux
    sudo yum install libsemanage-static libsemanage-devel

遗留问题

1. 汉化问题

对于管理员来说,使用英文界面略有困难。

2. 邮件配置问题

注册、找回密码、提交代码等各种需要发邮件的情况下,不能发送邮件。

3.使用SSH公私钥进行认证时,config文件配置问题

使用ssh-keygen -t rsa -C "name@domain.com"生成公私钥,并将私钥保存在~/.ssh目录,同时在gitlab管理页面将自己的公钥添加进去。
SSH keys允许自己的机器和gitlab服务器之间建立安全连接。
配置config文件,内容如下:
host gitlab_name
user git
hostname gitlab_server_host
port 22
identityfile ~/.ssh/name
在Eclipse中使用git进行clone项目时,可以使用以下地址:
// 协议默认为http,需要使用用户名、密码进行身份认证
http://192.168.111.129/root/demo.git

// 协议默认为空,使用公私钥进行身份认证。可修改协议为SSH,修改协议后,连接地址自动变为:ssh://git@192.168.111.129/root/demo.git
git@192.168.111.129:root/demo.git

可通过config文件指定多个gitlab服务器地址及其对应的公私钥,进行身份认证。
// 协议默认为空,使用公私钥进行身份认证。可修改协议为SSH,修改协议后,连接地址自动变为:ssh://gitlab_vm/root/demo.git
gitlab_vm:root/demo.git

最新文章

  1. OPENCV配置 C1083: 无法打开包括文件:“opencv2/opencv.hpp”
  2. Beanstalk消息队列的实现
  3. mysql 数据导出 常用总结
  4. CKEditor实现图片上传
  5. c How to Make an Ascii Picture.
  6. ASP.NET MVC在服务端把异步上传的图片裁剪成不同尺寸分别保存,并设置上传目录的尺寸限制
  7. 团队项目的NABC(截图软件)
  8. ANDROID_MARS学习笔记_S03_004_getAllProviders、LOCATIONLISTENER、getBestProvider
  9. 单链表(Single Linked List)
  10. js执行js字符串函数的方法
  11. 安卓弹出对话框——AlertDialog(二)
  12. ASP.NET Core 源码学习之 Options[1]:Configure
  13. SGU 223 Little Kings(状压DP)
  14. 使用正则表达式和数组形式获取get方法传入的值
  15. Memcached在.NET应用程序中的使用
  16. (Alpha)Let's-典型用户和场景&功能规格说明书
  17. hdu-4466-Triangle 数学题
  18. NLP 中的embedding layer
  19. OpenSource.iOS.ProtobufWithObjective-C
  20. 寒假短期学习计划 - C++

热门文章

  1. Setting up an OpenGL development environment in ubuntu
  2. ECShop研究:去掉标题中的Powered by ECShop和meta的<meta name="Generator" content="ECSHOP v2.7.3" />
  3. SpringAOP02 自定义注解
  4. python 将字符串转化为可执行代码
  5. 2.Hive的几种常见的数据导入方式
  6. 循环删除DataTable.Row中的多行问题
  7. LightOJ 1284 Lights inside 3D Grid (数学期望)
  8. Zynq 在Ubuntu上搭建编译环境
  9. 编写高质量代码改善C#程序的157个建议——建议22:确保集合的线程安全
  10. 【Android学习】实现卡片式ListView