centos7搭建Gitlab服务器

虚拟机配置信息

内存最好大于或等于4G,之前用2G内存搭建,访问出现502报错信息

不考虑selinux和防火墙问题

搭建之前最好关掉selinux和防火墙

临时调增selinux和关闭防火墙

下载Gitlab安装包

centos 6系统的下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6
centos 7系统的下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7

在Linux中下载命令:

#wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.5.4-ce.0.el7.x86_64.rpm

注意:没有wget命令可以安装

# yum install wget -y

安装依赖软件

#yum install curl policycoreutils-python openssh-server postfix -y

 查看rpm包

安装gitlab

# rpm -ivh gitlab-ce-11.5.4-ce.0.el7.x86_64.rpm 

修改gitlab配置文件指定服务器ip和自定义端口

# vi /etc/gitlab/gitlab.rb 

 修改之后

ps:注意这里设置的端口不能被占用,默认是8080端口,如果8080已经使用,请自定义其它端口,并在防火墙设置开放相对应得端口

重置gitlab配置

重置gitlab配置的时候有很长的代码要跑,会非常的慢,稍稍等待……

# gitlab-ctl reconfigure

重新启动gitlab

# gitlab-ctl restart

 打开浏览器输入

http://服务器IP地址:自定义端口号

 

 登录成功

假如GitLab在访问的时候经常502,原因可能是内存不足,可以配置虚拟内存。方法自行查资料解决,这里不再赘述

参考文献:

https://blog.csdn.net/duyusean/article/details/80011540

http://www.cnblogs.com/wenwei-blog/p/5861450.html

猜你喜欢

转载自www.cnblogs.com/djlsunshine/p/10140783.html