首先,参照了官网安装步骤。https://about.gitlab.com/installation/#centos-7
1.安装并配置必要的依赖项
在CentOS 7(和RedHat / Oracle / Scientific Linux 7)上,以下命令还将在系统防火墙中打开HTTP和SSH访问。
sudo yum install -y curl policycoreutils-python openssh-server
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
接下来,安装Postfix以发送通知电子邮件。如果要使用其他解决方案发送电子邮件,请跳过此步骤并在安装GitLab后配置外部SMTP服务器。
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
在Postfix安装期间,可能会出现配置屏幕。选择“Internet Site”并按Enter键。使用服务器的外部DNS作为“邮件名称”,然后按Enter键。如果出现其他屏幕,请继续按Enter键接受默认值。
2.添加GitLab软件包存储库并安装软件包
添加GitLab包存储库。
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
接下来,安装GitLab包。将`http:// gitlab.example.com`更改为您要访问GitLab实例的URL。安装将自动配置并启动该URL的GitLab。HTTPS 在安装后需要其他配置。
vi /etc/gitlab/gitlab.rb修改如下
external_url 'http://59.110.159.79:8085' //需要添加ip+端口或者(域名+端口)
设置完成之后:
重置配置
sudo gitlab-ctl reconfigure
重启gitlab服务
sudo gitlab-ctl restart
浏览器访问:http://59.110.159.79:8085/
问题汇总
1.改了端口,浏览器访问不到,这时需要注意centos firewall防火墙端口开放没有
2.浏览器访问502.一般是端口冲突,需另外改gitlab端口,步骤参考上面。改完端口,重启gitlab服务器
文章评论