快速搭建GitLab服务器

一、满足需要的环境

 

1.如果服务器需要开启防火墙,那就将添加http服务到firewalld,pemmanent表示永久生效

          sudo firewall-cmd --permanent --add-service=http

          重启防火墙:sudo systemctl reload firewalld

2.安装Postfix以发送通知邮件

          安装命令:sudo yum install postfix  (按enter键继续)

          启动postfix:sudo systemctl start postfix

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

 

二、安装GitLab服务器

 

1.安装GitLab

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

          安装GitLab:rpm -ivh gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm

          安装成功:

          

2.修改GitLab配置文件

          vim /etc/gitlab/gitlab.rb

                    external_url 'http://localhost:9090'    #外部访问URL

                    unicorn['listen'] = '127.0.0.1'             #unicorn默认监控IP

                    unicorn['port'] = 8008                       #unicorn默认使用端口,默认8080,如果冲突则可修改成其余端口。

          

3.重置并启动GitLab

          gitlab-ctl reconfigure

          gitlab-ctl restart

          启动成功:

          

三、访问GitLab页面

          http://ip:9090/

          进去后会提醒你重新设置密码,用户名默认为:root

 

四、可能出现的问题

1.注意使用的端口是否被占用

2.如果出现莫名其妙的问题,那么可以尝试重启gitlab-ctl restart

3.报502,GitLab官网指定内存需要4G以上

4.初始登陆没有提示,尝试使用

          账户:root

          密码:5iveL!fe

5.防火墙也有可能是这个 iptables

          永久关闭防火墙:chkconfig iptables off

 

五、延展

如果需要GitLab初始化一个项目的详解,那么可以前往

https://blog.csdn.net/csdnmhr/article/details/99413736

 

 

 

 

 

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值