centos7系统GitLab服务器搭建

1、GitLab介绍

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

Gitlab 是被广泛使用的基于 git 的开源代码管理平台,基于 Ruby on Rails 构建, 主要针对软件开发过程中产生的代

码和文档进行管理,Gitlab 主要针对 group 和 project 两个维度进行代码和文档管理,其中 group 是群组,

project是工程项目,一个 group 可以管理多个 project,可以理解为一个群组中有多项软件开发任务,而一个

project 中可能包含多个 branch,意为每个项目中有多个分支,分支间相互独立,不同分支可以进行归并。

2、GitLab安装

如果某些步骤已经操作过了,则无需执行。

2.1 安装SSH依赖

yum install -y curl policycoreutils-python openssh-server

2.2 启动SSH服务

[root@VM-8-8-centos lighthouse]# systemctl enable sshd
[root@VM-8-8-centos lighthouse]# systemctl start sshd

# 查看启动状态
[root@VM-8-8-centos lighthouse]# systemctl status sshd
● sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2024-05-24 11:35:45 CST; 2h 36min ago
     Docs: man:sshd(8)
           man:sshd_config(5)
 Main PID: 1636 (sshd)
   CGroup: /system.slice/sshd.service
           └─1636 /usr/sbin/sshd -D

2.3 设置防火墙-启用IP转发功能

vim /etc/sysctl.conf
# 在文件末尾添加
net.ipv4.ip_forward = 1

2.4 安装并启动防火墙

yum install firewalld systemd -y
systemctl enable firewalld
systemctl start firewalld
systemctl status firewalld

#查看启动情况
[root@VM-8-8-centos lighthouse]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2024-05-24 14:20:56 CST; 35s ago
     Docs: man:firewalld(1)
 Main PID: 29060 (firewalld)
   CGroup: /system.slice/firewalld.service
           └─29060 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid

2.5 添加HTTP服务到firewalld

[root@VM-8-8-centos lighthouse]# firewall-cmd --permanent --add-service=http
success
[root@VM-8-8-centos lighthouse]# systemctl reload firewalld

其中,pemmanent 表示永久生效,若不加 --permanent 系统下次启动后就会失效。

2.6 安装Postfix以发送邮件

yum install postfix
systemctl enable postfix
systemctl start postfix
systemctl status postfix

# 查看启动情况
[root@VM-8-8-centos lighthouse]# systemctl status postfix
● postfix.service - Postfix Mail Transport Agent
   Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2024-05-24 11:35:45 CST; 2h 50min ago
 Main PID: 1360 (master)
   CGroup: 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值