gitlab 在服务器上的搭建

gitlab 在服务器上的搭建

1、首先安装一些相关的依赖

yum -y install policycoreutils openssh-server openssh-clients postfix

policycoreutils : 不知道干嘛用的

openssh-server openssh-clients: 允许远程连接工具来连接服务器的东西

postfix: 发送邮件的东西,需要开启,gitlab才能发送邮件,开启的时候可能会报错

  • Job for postfix.service failed because the control process exited with error code. See “systemctl status postfix.service” and “journalctl -xe” for details.

解决:

  • vim /etc/hosts //注释掉下面一行
    #::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
启用postfix
systemctl enable postfix && sudo systemctl start postfix

2、安装

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

yum install -y gitlab-ce

gitlab-ctl reconfigure

gitlab-ctl restart

3、修改端口

vi /etc/gitlab/gitlab.rb
   *  修改 nginx['listen_port'] = 8081

gitlab-ctl reconfigure

gitlab-ctl restart

4、搭建nginx服务器

https://blog.csdn.net/u010398650/article/details/79532970

5、nginx代理

upstream git {
	server localhost:8099;
}
server{
    server_name gitlab.yuanjy.com;
    listen 80;

    location / {
        client_max_body_size 50m;

        proxy_redirect off;
        #以下确保 gitlab中项目的 url 是域名而不是 http://git,不可缺少
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://git;
    }
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值