Centos7安装Gitlab

一、安装依赖

    sudo yum install -y curl policycoreutils-python openssh-server
    sudo systemctl enable sshd
    sudo systemctl start sshd

    (防火墙如果关闭不需要)
    sudo firewall-cmd --permanent --add-service=http
    sudo firewall-cmd --permanent --add-service=https
    sudo systemctl reload firewalld

二、选择安装邮件服务

    sudo yum install postfix
    sudo systemctl enable postfix
    sudo systemctl start postfix


三、安装gitlab-ce仓库和安装包

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

四、安装gitlab

信任gitlab公钥
curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null
使用清华大学镜像
vim /etc/yum.repos.d/gitlab-ce.repo
添加如下内容:
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1
yum makecache
sudo EXTERNAL_URL="http://192.168.159.133" yum install -y gitlab-ce
EXTERNAL_URL后面为域名或者主机

五、gitlab配置文件

/etc/gitlab/gitlab.rb

六、其他相关命令

如修改配置文件后,重载配置:gitlab-ctl reconfigure
重启:gitlab-ctl restart
开机启动:systemctl enable gitlab-runsvdir.service
禁止开机启动:systemctl disable gitlab-runsvdir.service

七、访问

使用之前的EXTERNAL_UR访问,并注册账号和密码(初次)

八、卸载

sudo gitlab-ctl stop
sudo rpm -e gitlab-ce
ps aux | grep gitlab 查看进程,杀掉第一个守护进程
find / -name gitlab | xargs rm -rf 删除所有包含gitlab文件

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值