美文网首页
centOS7搭建Gitlab

centOS7搭建Gitlab

作者: captainLii | 来源:发表于2021-01-06 10:14 被阅读0次

1、gitlab下载地址
下载最新的版本

gitlab
备注:下载比较慢
2、安装
(1)错误
# rpm -i gitlab-ce-13.7.1-ce.0.el7.x86_64.rpm
error

(2)安装policycoreutils-python

# yum install policycoreutils-python
policycoreutils-python

(3)重新安装gitlab-ce-13.7.1-ce.0.el7.x86_64.rpm

# rpm -i gitlab-ce-13.7.1-ce.0.el7.x86_64.rpm
配置文件

(4)配置ip与端口

# vim /etc/gitlab/gitlab.rb
  • 修改内容
- 服务器ip
external_url 'http://ip'
unicorn['port']=8089
nginx['listen_port']=8089
image.png
    • 这里设置的端口不能被占用,默认是8080端口,如果8080已经使用,请自定义其它端口,并在防火墙设置开放相对应得端口。

(4.1)修改自带的nginx配置

# vim /var/opt/gitlab/nginx/conf/gitlab-http.conf

(4.2)安装postfix

sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix

(5)重置并启动GitLab

- 生效配置 时间相对较久
# gitlab-ctl reconfigure

# gitlab-ctl restart
生效配置
生效配置成功
重启成功

(6)开放8089端口

# firewall-cmd --zone=public --add-port=8089/tcp --permanent
# firewall-cmd --reload

(7)访问gitlab界面,地址:http://ip:8089/

image.png
(8)创建密码,然后登录
    • 密码要有大小写,然后使用root,加上刚设置的密码


      主页

      (8)其它命名

- 关闭
# gitlab-ctl stop
- 开启
# gitlab-ctl start
- 查看状态 
# gitlab-ctl status

(9)本地git clone 项目时遇到 port:xxxx:Connection refused


image.png

解决:修改 cd /opt/gitlab/embedded/service/gitlab-rails/config下的 gitlab.yml

  • 原因在gitlab.rb中配置一nginx的监听端口,所以在执行gitlab-ctl reconfigure后,gitlab.yml默认的端口还是80,所以修改如下,修改完成后,重启就好了gitlab-ctl restart
  • 只要执行gitlab-ctl reconfigure后都需要检查端口是否被覆盖


  • 重启完成后,项目的http clone方式会带上指定的端口


    image.png

相关文章

  • GitLab install

    CentOS7服务器上搭建Gitlab Gitlab如何搭建? 安装gitlab所需要的依赖sudo yum in...

  • Centos7.2搭建gitlab服务器

    一, 服务器快速搭建gitlab方法可以参考gitlab中文社区 的教程centos7安装gitlab:https...

  • Gitlab搭建指南

    1.本文目标 在centOS7系统上成功装上Gitlab 2.准备工作 需要自己搭建CentOS7系统,不管是在服...

  • Gitlab搭建,配置邮件服务

    Gitlab 在Centos7 搭建 用docker方式安装: 等待数分钟后,容器服务器全部起来,访问http:/...

  • (二)Git+Gitlab连接使用

    前置条件:git客户端windows,gitlab服务端搭建,centos7系统 一、Git客户端安装,创建本地仓...

  • centos6.x搭建gitlab

    可以参考gitlab中文社区 的教程 centos7安装gitlab:https://www.gitlab.cc/...

  • CentOS7搭建gitlab

    由于公司需要一套好的代码托管平台,于是选择了gitlab社区版10.7.3 gitlab的搭建 基础组件的安装首先...

  • centos7搭建gitlab

    虽然可托管代码的平台有很多选择,国外的有 github,国内的有 gitee, coding 之类,但很多公司都会...

  • CentOS7 GitLab搭建

    经过实操,总结以下几点: 1、谷歌云默认有SSH协议,防火墙,postfix,可以略过2、阿里云是一片空白,啥都没...

  • centOS7搭建Gitlab

    1、gitlab下载地址[https://mirrors.tuna.tsinghua.edu.cn/gitlab-...

网友评论

      本文标题:centOS7搭建Gitlab

      本文链接:https://www.haomeiwen.com/subject/sdywoktx.html