linux安装GitLab

GitLab简介

GitLab 是一个用于仓库管理系统的开源项目,使用Git作为代码管理工具,并在此基础上搭建起来的web服务

GitLab和GitHub一样属于第三方基于Git开发的作品,免费且开源(基于MIT协议),与Github类似,可注册用户,任意提交你的代码,添加SSHKey等等。区别是,GitLab是可部署到自己服务器上,数据库等一切信息都掌握在自己手上,适合团队内部协作开发,你总不可能把团队内部的资产放在别人的服务器上吧?简单来说可把GitLab看作个人版的GitHub

 

 

一、安装并配置必要的依赖关系

 

1.安装ssh

 

sudo yum install -y curl policycoreutils-python openssh-server

 

2、启动ssh并设置为开机自启动

 

sudo systemctl enable sshd
systemctl start sshd

 

3、添加http服务到firewalld,pemmanent表示永久生效,若不加--permanent系统下次启动后就会失效

 

systemctl start firewalld
firewall-cmd --permanent --add-service=http
systemctl reload firewalld

 

4、启动postfix

 

systemctl enable postfix
systemctl start postfix

 

5、下载gitlab安装文件

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm

 

6、执行安装

rpm -i gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm

7、编辑ip和端口

vim /etc/gitlab/gitlab.rb

将external_url变量的地址修改为gitlab所在centos的ip地址。
external_url ‘http://git.home.com’

 

8、启动Git

gitlab-ctl reconfigure

gitlab-ctl restart

linux安装GitLab_第1张图片

 

如果启动不起来,在页面上显示502的话,8080端口被占用了,更改端口

你可能感兴趣的:(运维环境搭建)