linux安装gitlab

gitlab介绍

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

linux安装gitlab

安装(Centos7)

安装相关依赖

yum -y install policycoreutils openssh-server openssh-clients postfix policycoreutils-python

启动ssh服务,设置为开启启动

systemctl enable sshd && sudo systemctl start sshd

设置ssh以及http服务,并启动,postfix支持gitlab发信功能

systemctl enable postfix && systemctl start postfix

开放ssh以及http服务,然后重新加载防火墙

firewall-cmd --add-service=ssh --permanent
firewall-cmd --add-service=http --permanent
firewall-cmd --reload

如果关闭防火墙就不需要做以上配置

下载gitlab包,并安装

yum install -y wget
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.9.9-ce.0.el7.x86_64.rpm
rpm  -ivh gitlab-ce-12.9.9-ce.0.el7.x86_64.rpm

linux安装gitlab

看到图标后,说明安装成功

上图提示我们可以修改/etc/gitlab/gitlab.rb配置文件

1.修改nginx默认监听端口为82

linux安装gitlab

2.配置外部访问url为 http://192.168.1.50:82

linux安装gitlab

重载配置及启动gitlab

reconfigure的时间比较长,需要几分钟时间,等待一下。

gitlab-ctl reconfigure
gitlab-ctl restart

端口添加到防火墙

firewall-cmd --zone=public --add-port=82/tcp --permanent
firewall-cmd --reload

登陆界面:192.168.1.50:82(如果出现502页面,说明gitlab没有完全启动,需要等待一会)

linux安装gitlab

修改密码后,用root账号登陆,进入首页,至此gitlab安装完毕。

linux安装gitlab

linux安装gitlab

上一篇:【linux】 bashrc文件的alias添加快捷命令


下一篇:Linux 安装配置 OSSIM-HIDS