Gitlab的安装

# GitLab Server 的搭建python

 

参考 https://about.gitlab.com/installationgit

 

 

## 1. 准备工做vim

 

以Centos7为例,准备一台至少内存为4G的机器。bash

 

 

## 2. 安装依赖软件ssh

 

 

```curl

sudo yum install -y git vim gcc glibc-static telnetgitlab

sudo yum install -y curl policycoreutils-python openssh-serverpost

sudo systemctl enable sshd测试

sudo systemctl start sshd阿里云

 

sudo yum install postfix

sudo systemctl enable postfix

sudo systemctl start postfix

```

 

 

## 3. 设置gitlab安装源

 

若是在国内的话,能够尝试使用清华大学的源。

 

新建 /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

```

 

若是在国外的话,能够使用

 

```

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

```

 

## 4. 安装GitLab

 

关于域名,若是要是设置域名,则以下,这个域名能够是真实购买的域名,若是您要把gitlab安装到公网好比阿里云上的话。

 

若是只是想本地测试,则能够像下面同样,设置一个example的域名,而后记得在本地你的笔记本设置host,若是是MAC就在 /etc/hosts里添加 一行 `192.168.211.10 gitlab.example.com`  

 

```

sudo EXTERNAL_URL="http://gitlab.example.com" yum install -y gitlab-ce

```

 

若是不想设置域名,或者想未来再考虑,能够直接

 

```

sudo yum install -y gitlab-ce

```

 

安装完成之后,运行下面的命令进行配置

 

```

sudo gitlab-ctl reconfigure

```

 

## 5. 登录和修改密码

 

 

打开http://gitlab.example.com/ 修改root用户密码,而后使用root和新密码登录。

 

 

![gitlab](img/gitlab-1.png)

相关文章
相关标签/搜索