部署 GitLab 服务器

本文详细介绍如何在服务器上部署GitLab,包括安装依赖、设置SSH、安装Postfix、添加GitLab软件包仓库、安装GitLab及汉化过程。通过本指南,读者可以了解并掌握GitLab服务器的完整部署步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

部署 GitLab 服务器

下载地址
官方教程

# 安装依赖包
[root@root ~]# sudo yum install -y curl policycoreutils-python openssh-server
# 设置SSH开机自启动
[root@root ~]# sudo systemctl enable sshd
# 启动SSH服务
[root@root ~]# sudo systemctl start sshd
# 安装Postfix来发送通知邮件
[root@root ~]# sudo yum install postfix
# 设置Postfix开机自启动
[root@root ~]# sudo systemctl enable postfix
# 修改 Postfix 配置文件
[root@root ~]# vim /etc/postfix/main.cf
# 启动Postfix服务
[root@root ~]# sudo systemctl start postfix
inet_interfaces = localhost 改成 inet_interfaces = all
# 添加GitLab软件包仓库
[root@root ~]# curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
# 安装GitLab
[root@root ~]# sudo EXTERNAL_URL="GitLab服务器的公网IP地址" yum install -y gitlab-ce

阿里云添加安全组规则

汉化GitLab

下载地址(选择对应版本)

# 查看gitlab版本
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION

# 下载汉化包
wget方式(指定版本)
wget https://gitlab.com/xhang/gitlab/-/archive/11-9-stable/gitlab-11-9-stable.tar.gz

# 解压
tar -axvf gitlab-11-9-stable.tar.gz 
解压后可以直接删除下载的压缩文件了

# 查看版本号   gitlab-11-9-stable  是我的解压文件,你自己要看下你的是什么
cat gitlab-11-9-stable/VERSION
或者
cat gitlab/VERSION

# 备份gitlab
cd /opt/gitlab/embedded/service
mv gitlab-rails  pre  // 将原配置文件更名为 pre
mv /home/vagrant/gitlab-11-9-stable/   gitlab-rails   // 将下载的汉化包,移动过来,并更名

# 重启配置及重启gitlab
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值