原创

Linux安装Gitlab

温馨提示:
本文最后更新于 2018年06月14日,已超过 2,142 天没有更新。若文章内的图片失效(无法正常加载),请留言反馈或直接联系我

什么是Gitlab

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

官网地址

首页:https://about.gitlab.com/
安装说明:https://about.gitlab.com/installation/

安装命令

因为网络原因,你在Linux服务器下载可能会比较慢,所以推荐本地下载再上传。

Windows本地下载https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-10.8.2-ce.0.el7.x86_64.rpm,下载好之后上传到Linux服务器。

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

rpm -ivh /tools/gitlab-ce-10.8.2-ce.0.el7.x86_64.rpm

yum install -y lokkit

lokkit -s http -s ssh

yum install postfix

service postfix start

chkconfig postfix on

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | bash

EXTERNAL_URL="http://gitlab.lzhpo.com" yum -y install gitlab-ce

安装Postfix

Postfix是一个邮件服务器,GitLab发送邮件需要用到。

sudo yum install -y postfix
#启动postfix并设置为开机启动
sudo systemctl enable postfix
sudo systemctl start postfix

gitlab 服务操作

初始化配置 gitlab

gitlab-ctl reconfigure

启动 gitlab 服务

gitlab-ctl start

停止 gitlab 服务

gitlab-ctl stop

打开浏览器访问

需要在Windows修改host文件

192.168.200.150    gitlab.lzhpo.com

访问:http://gitlab.lzhpo.com
默认是设置登录名为root的密码,不要设置的过于简单。

附加

修改地址

如果前面EXTERNAL_URL="http://gitlab.lzhpo.com" yum -y install gitlab-ce已经修改了,这里可以不用修改了。

#修改配置文件
vi /etc/gitlab/gitlab.rb

#配置首页地址(大约在第15行)
external_url 'http://gitlab.lzhpo.com'

关闭防火墙

#查看防火墙状态
systemctl status firewalld.service
###关闭防火墙
systemctl stop firewalld.service
###设置防火墙开机不自启
systemctl disable firewalld.service

关闭SELinux

#临时关闭SELinux
setenforce 0
#永久关闭SELinux
vi /etc/selinux/config (SELINUX=disabled)
相关文章
本文目录