阿里云搭建gitlab

本文详细介绍在阿里云CentOS7.3环境下安装Gitlab的过程,包括安装环境依赖组件、配置文件修改、Gitlab包安装及汉化步骤。通过本文,读者可以了解如何设置SSH、Postfix邮件服务,配置防火墙,以及如何初始化Git仓库和创建Git用户。

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

Gitlab

1环境 阿里云centOS7.3

安装所需环境依赖组件

 sudo yum install curl policycoreutils openssh-server openssh-clients

  sudo systemctl enable sshd

  sudo systemctl start sshd

  sudo yum install postfix

  sudo systemctl enable postfix

  sudo systemctl start postfix

  sudo firewall-cmd --permanent --add-service=http

  sudo systemctl reload firewalld

安装Gitlab包

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

sudo yum install gitlab-ce

3配置文件

vi /etc/gitlab/gitlab.rb

(1)配置访问IP及端口或使用域名

13行

 

 

Gitlab-ctl restart

 

浏览器访问

gitlab 修改root用户密码

gitlab-rails console production

 

 

 

Gitlab 汉化

查看版本

cat /opt/gitlab/embedded/service/gitlab-rails/VERSION

克隆版本库

git clone https://gitlab.com/xhang/gitlab.git

比较汉化标签和原标签

 

 

安装git

yum -y install git

在需要的地方创建一个仓库

 

git init --bare learngit.git

创建一个Git用户

useradd Git

修改密码

passwd git

赋予用户权限

chown -R git:git learngit.git

禁用Git用户shell登录

创建ssh key

ssh-keygen -t rsa -C "了394302651@163.com"

服务器端 进入 /etc/ssh/sshd_config

1.RSAAuthentication yes

2.PubkeyAuthentication yes

3.AuthorizedKeysFile .ssh/authorized_keys

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值