[原创]在Centos7上搭建私有的Gitlab服务器
前言
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)
官方教程
- 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
- 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
- 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
[原创]在Centos7上搭建私有的Gitlab服务器的更多相关文章
- centos7 上搭建私有云
OwnCloud环境搭建 一. 环境搭建 1. 环境需求 服务器操作系统:Centos7.0 外网服务器操作系统:Centos7.0 Php版本号:5.4.16 Mysql版本号:5.5.52 Apa ...
- 如何在CentOS7上搭建自己的GitLab仓库
序言 各位好啊,我是会编程的蜗牛,作为java开发者,在团队开发中,一般都是需要使用git及git仓库来管理我们的代码的,这非常方便.我以前在小公司的时候,基本都是一个人开发一个项目,所以也没有怎么接 ...
- 在CentOS 6上搭建私有的Docker Registry
在CentOS 6上搭建私有的Docker Registry v2Registry概念 :Registry是一个无状态的, 高可扩展的服务器端应用程序, 用于存储和分发Docker Image. 依赖 ...
- 在Dropbox上搭建私有的Git仓库的教程
导读 Git版本控制系统需要一个服务器端,而GitHub上要想创建私有的Git服务器端仓库则触及到收费项目,于是这里我们利用Dropbox的免费空间,来看一下在Dropbox上搭建私有的Git仓库的教 ...
- centos7上搭建开源系统jforum
centos7上搭建好tomcat,mysql; 将 jforum-2.6.2.war放到tomcat目录的webapps下: 启动tomcat,./startup.sh ,查看webapp下jfor ...
- 在阿里云上搭建自己的git服务器
这篇文章我就来介绍一下如何在一台全裸的阿里云主机上搭建自己的git服务器. 1. 安装git 首先安装git,一般而言,现在的服务器已经内置了git安装包,我们只需要执行简单的安装命令即可安装.比如: ...
- 第四百零五节,centos7下搭建sentry错误日志服务器,接收python以及Django错误,
第四百零五节,centos7下搭建sentry错误日志服务器,接收python以及Django错误, 注意:版本,不然会报错 Docker >=1.11Compose >1.6.0 通过d ...
- [深度学习] centos7上搭建基于Anaconda3的caffe+pycaffe环境(python3.6)
本文记录从零开始在CentOS7.x系统上搭建Caffe深度学习平台,并配置pycaffe环境.(由于在虚拟机上搭建,所以为CPU_ONLY模式) 1.选择CentOS7 mini版镜像安装虚拟机 镜 ...
- Centos7上搭建redis主从
1. 节点(服务器)数量说明 按照redis官方建议:salve和master的数量按照2n+1台服务器(1台master节点,2n台slave节点) 有兴趣的可以了解下redis的master选举机 ...
随机推荐
- 张超超OC基础回顾01_类的创建,申明属性,以及本质
一. 类的声明和实现&规则 1.如何编写类的声明 以@interface开头 , 以@end结尾, 然后再class name对应的地方写上 事物名称, 也就是类名即可 注意: 类名的首字符必 ...
- Linux gtypist
一.简介 Typist (gtypist)是一个打字练习软件,用来提升打字的速度. 二.安装 1)源码方式 http://ftp.gnu.org/gnu/gtypist/ 三.使用 http: ...
- Python pip命令
一.简介 pip 是一个安装和管理 Python 包的工具 , 是 easy_install 的一个替换品.distribute是setuptools的取代(Setuptools包后期不再维护了),p ...
- 一步之遥——第七届蓝桥杯C语言B组(国赛)第一题
原创 一步之遥 从昏迷中醒来,小明发现自己被关在X星球的废矿车里.矿车停在平直的废弃的轨道上.他的面前是两个按钮,分别写着“F”和“B”. 小明突然记起来,这两个按钮可以控制矿车在轨道上前进和后退.按 ...
- eclipse启动了tomcat,但是浏览器打不开欢迎页
tomcat在eclipse中启动成功,主页却打不开 症状: tomcat在eclipse里面能正常启动,而在浏览器中访问http://localhost:8080/不能访问,且报404错误.同时其他 ...
- CentOS 网络操作
ifconfig:查看网卡信息 网卡配置文件位置: /etc/sysconfig/network-scripts/文件夹 nmtui:配置网卡 netstat -tlunp:查看端口信息 端口信息存储 ...
- angular 输出属性
import { Component, OnInit, EventEmitter, Output } from '@angular/core'; @Component({ selector: 'app ...
- visual studio installer 卸载时不能删除安装目录问题
在vs中可以制作安装程序,但是这个安装程序默认卸载的时候不会把安装目录卸载,如果想在卸载的时候删除这个目录,那就要费点周折了.此方法同时适应于程序自删除以及工作目录删除. 基本思路是在程序要退出的 ...
- mac下redis和zookeeper启动及测试命令
mac下启动命令: sudo su - root cd /usr/local/bin/ ./redis-server ../etc/redis.conf cd /software/zook ...
- leecode刷题(4)-- 存在重复数组
leecode刷题(4)-- 存在重复数组 存在重复数组 题目描述: 给定一个整数数组,判断是否存在重复元素. 如果任何值在数组中出现至少两次,函数返回 true.如果数组中每个元素都不相同,则返回 ...