CentOS 7安裝gitlab服務器 原

提示:以下操作均在root用戶下操作,如使用sudo,請自行根據實際執行命令

1、Gitlab依賴以及相關軟件安裝

在CentOS 7系統上,下面的命令將會打開系統防火牆HTTP和SSH訪問。

yum install -y curl policycoreutils-python openssh-server
systemctl enable sshd
systemctl start sshd
yum install postfix
systemctl enable postfix
systemctl start postfix
firewall-cmd --permanent --add-service=http
systemctl reload firewalld

2、添加GitLab鏡像源並安裝

curl -sS http://packages.gitlab.com.cn/install/gitlab-ce/script.rpm.sh | bash

這是官方的yum源,安裝速度會比較慢,可以使用國內源,修改如下文件即可:

vi /etc/yum.repos.d/gitlab_gitlab-ce.repo        ##ps:centos默認沒有安裝vim,因此我修改了

修改內容如下:

[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key

3、安裝Gitlab

yum install gitlab-ce      ### 安裝

### 配置並啓動 GitLab ###
gitlab-ctl reconfigure

Reference:

http://www.yuanrengu.com/index.php/20171112.html

https://yq.aliyun.com/articles/74395

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章