Linux:搭建GitLab

天大地大妈咪最大 提交于 2019-12-05 06:26:41

0.写在前面

GitLab官方明确要求最低配置2核4G,如果配置过低,会出现502错误。

1.安装SSH

#安装ssh
sudo yum install -y curl policycoreutils-pythonopenssh-server

#将SSH服务设置成开机自启动
sudo systemctl enable sshd

#启动SSH服务
sudo systemctl start sshd

2.安装防火墙

#安装防火墙
yum install firewalld systemd -y

#开启防火墙
service firewalld start

#添加http服务到firewalld,pemmanent表示永久生效,若不加--permanent系统下次启动后就会失效
sudo firewall-cmd --permanent --add-service=http

#重启防火墙,安装命令
sudo systemctl reload firewalld

开启防火墙之后,导致服务器访问不了,可以停掉:service firewalld stop

3.安装Postfix

 

#安装Postfix以发送通知邮件
sudo yum install postfix

#将postfix服务设置成开机自启动
sudo systemctl enable postfix

#启动postfix
sudo systemctl start postfix

 

4.安装GitLab

#wget未安装则进行安装
yum -y install wget

#下载GitLab安装包
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.4.3-ce.0.el7.x86_64.rpm

#安装
rpm -ivh gitlab-ce-12.4.3-ce.0.el7.x86_64.rpm

EL是Red Hat Enterprise Linux的简写

  • EL5软件包用于在Red Hat 5.x, CentOS 5.x, CloudLinux 5.x的安装

  • EL6软件包用于在Red Hat 6.x, CentOS 6.x, and CloudLinux 6.x进行安装

  • EL7 软件包用于在Red Hat 7.x, CentOS 7.x, and CloudLinux 7.x的安装

cat /etc/redhat-release 查看CentOS版本

 

5.配置GitLab

 

#修改gitlab配置文件指定服务器ip和自定义端口:
vim  /etc/gitlab/gitlab.rb

修改这个参数
external_url 'ip:port'

#重置并启动GitLab
gitlab-ctl reconfigure
gitlab-ctl restart

 

 

 

 

 

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!