Centos7安装部署Gitlab
Posted jason007
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Centos7安装部署Gitlab相关的知识,希望对你有一定的参考价值。
1.准备环境
[[email protected] ~]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
[[email protected] ~]# uname -a
Linux gitlab 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
2.更新软件包
yum update -y
3.安装sshd
yum install -y curl policycoreutils-python openssh-server
systemctl enable sshd
systemctl start sshd
4.安装配置防火墙
vim /etc/sysctl.conf
添加一行
net.ipv4.ip_forward = 1
yum -y install firewalld
systemctl enable firewalld
systemctl start firewalld
放通HTTP
firewall-cmd --permanent --add-service=http
systemctl reload firewalld
5.安装postfix
yum install -y postfix
vim /etc/postfix/main.cf
在第 119 行附近找到 inet_protocols = all,将 all 改为 ipv4
inet_protocols = ipv4
systemctl enable postfix
systemctl start postfix
6.配置swap交换分区
dd if=/dev/zero of=/root/swapfile bs=1M count=2048
mkswap /root/swapfile
swapon /root/swapfile
添加自启动
vim /etc/fstab
/root/swapfile swap swap defaults 0 0
7.安装gitlab
7.1修改yum源
cd /etc/yum.repos.d
vim 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
7.2安装gitlab
yum makecache
yum install -y gitlab-ce
7.3初始化gitlab
vim /etc/gitlab/gitlab.rb 修改第十三行
external_url ‘http://work.myteam.com‘改成自己的域名
初始化gitlab:
sudo gitlab-ctl reconfigure
以上是关于Centos7安装部署Gitlab的主要内容,如果未能解决你的问题,请参考以下文章