Centos7安装部署Gitlab

1.准备环境

[root@gitlab ~]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
[root@gitlab ~]# 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

猜你喜欢

转载自www.cnblogs.com/jason007/p/9396235.html