用GitLab搭建自己的私有GitHub

现在git是开发人员的必备技能之一,github的代码仓库管理系统目前是最好的,下面搭建私有github系统的过程。

下载gitlab:

官网地址:https://about.gitlab.com/install/

Download a GitLab Omnibus package (recommended installation)

安装gitlab:

点击对应操作系统图标可以看到详细的安装步骤教程。

===============

sudo apt-get update

sudo apt-get install -y curl openssh-server ca-certificates

sudo apt-get install -y postfix

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

Next, install the GitLab package. Change https://gitlab.example.com to the URL at which you want to access your GitLab instance. Installation will automatically configure and start GitLab at that URL.

sudo EXTERNAL_URL="https://gitlab.example.com" apt-get install gitlab-ee

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 firewall-cmd --permanent --add-service=https

sudo systemctl reload firewalld

安装Postfix 邮件通知功能

sudo yum install postfix

sudo systemctl enable postfix

sudo systemctl start postfix

2. Add the GitLab package repository.

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

sudo EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ee

==============

之后就可以直接使用浏览器访问 http://ip 登录管理

个性化配置 和 注意事项

使用自己的nignx:

$ apt-get install nginx #安装nginx

$ cd /etc/nginx/conf.d && touch gitlab-http.conf

Nginx gitlab-http.conf 配置:

upstream gitlab-workhorse {

#server unix:/var/opt/gitlab/gitlab-workhorse/socket;

server 127.0.0.1:8080;

}

upstream gitlab-git-http-server {

server 127.0.0.1:8181;

}

server {

listen *:80;

server_name gitlab.guowei.com;

root /opt/gitlab/embedded/service/gitlab-rails/public;

client_max_body_size 0;

location / {

proxy_read_timeout 300;

proxy_connect_timeout 300;

proxy_redirect off;

proxy_http_version 1.1;

proxy_set_header Host $http_host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-Forwarded-Proto http;

proxy_pass http://gitlab-workhorse;

}

location ~ [-\/\w\.]+\.git\/ {

proxy_read_timeout 300;

proxy_connect_timeout 300;

proxy_redirect off;

proxy_buffering off;

proxy_set_header Host $http_host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-Forwarded-Proto $scheme;

proxy_pass http://gitlab-git-http-server;

}

location ~ ^/[\w\.-]+/[\w\.-]+/repository/archive {

client_max_body_size 0;

error_page 418 = @git-http-server;

return 418;

}

location @git-http-server {

proxy_read_timeout 300;

proxy_connect_timeout 300;

proxy_redirect off;

proxy_buffering off;

proxy_set_header Host $http_host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-Forwarded-Proto $scheme;

proxy_pass http://gitlab-git-http-server;

}

}

配置gitlab不使用nginx:

$ vim /etc/gitlab/gitlab.rb

# search nginx find nginx['enable'] = true

# add

nginx['enable'] = false

gitlab_git_http_server['listen_network'] = "tcp"

gitlab_git_http_server['listen_addr'] = "127.0.0.1:8181"

# nginx['enable'] = true

$ gitlab-ctl reconfigure #配置gitlab

$ gitlab-ctl restart #重启服务

卸载gitlab:

# Stop gitlab and remove its supervision process

sudo gitlab-ctl uninstall

# Debian/Ubuntu

sudo dpkg -r gitlab-ce

# Redhat/Centos

sudo rpm -e gitlab-ce

注意事项:

为了方便以http的方式操作git仓库,在nginx中有个8181端口的配置(对应gitlab.rb中的gitlab_git_http_server配置)

下载仓库代码问题,有的可以下载,有的不可以下载

主要是国外的库问题,可以配置下本地源加快下载速度和成功率

github 私有化部署_用GitLab搭建自己的私有GitHub相关推荐

  1. github 私有化部署_项目私有化部署

    文章来自:CrapApi --API接口管理系统,转载请注明出处! CrapApi所有演示系统(官网.试用)及数据库均使用阿里云服务器,为了保证系统安装顺利,建议购买阿里云Centos系统服务器:ht ...

  2. Gitlab 搭建本地局域网私有仓库

    Gitlab 关于Gitlab,首先需要厘清下面相关概念: Git是版本控制工具 GitServer是远程管理仓库,没有界面,只能使用命令行 Gitlab是私有代码库Web管理工具 Github相当于 ...

  3. typora绑定github博客_零基础搭建个人博客

    因为懒得再写一遍了,所以直接复制过来了,建议直接去文章地址查看 文章链接: https://hmoumou.xyz/2020/08/14/shi-yong-github-pages-hexo-da-j ...

  4. 100+文档格式预览,私有化部署,10分钟搭建专属IM

    即时通讯是已经深入到我们的工作.学习和工作中,用户数量节节高升. <中国即时通信市场现状深度分析与发展前景预测报告(2022-2029年)>显示:2021年我国即时通讯用户为10.07亿人 ...

  5. github使用指南_所有开源项目免费使用,GitHub 内置 CI/CD 终于来了

    2019 年 8 月 8 日,GitHub 官方博客发文称,程序员期待已久的功能来了,Github Actions 终于支持内置 CI/CD 了,并对所有开源项目免费!目前该功能可以在 Beta 版本 ...

  6. github 怎么搜索_实用!8个玩转GitHub的小插件,快来试试吧!

    作为程序员对 GitHub 应该都不会陌生,我经常沉迷其中,找一些惊艳的项目或者工具.不过用的时间久了,发现它的用户体验实在是不敢恭维,有时候会让你做很多重复操作,浪费不少时间. 比如我想单独下载一个 ...

  7. github private链接访问_如何将Jenkins链接到私有Github存储库?

    我的目标是将私有Github存储库拉到Jenkins . 以下是一些背景: MacOS Jenkins在本地托管, localhost:8080 在Jenkins中安装了Git插件和Github插件 ...

  8. gitlab ci 自动化部署_前端gitLab加jenkins自动化构建和部署,以及服务器常用的linux命令行操作,免密登录...

    常用的linux命令行操作 将项目部署到服务器后,需要查看文件是否已经部署成功,已经对文件进行增删改查操作,就需要用到命令行操作,常用操作如下: ll 罗列出当前文件或目录的详细信息,含有时间.读写权 ...

  9. github 私有化部署_2019,GitHub 宣布私有代码仓库从此免费!

    微软收购 GitHub 后,官方宣布了一项重大更新:免费开放私有代码库,即 GitHub 用户现在可以免费创建无限量的私有存储库.同时还有另一项更新--GitHub Enterprise,结合了企业云 ...

最新文章

  1. 服务器论坛有哪些_SEO工作中,经常使用的无效外链有哪些?
  2. An error occurred during the file system check
  3. Coil - Google推荐的协程图片加载库
  4. PCA(主成分分析)思想及实现
  5. Windows Boot Manager改成中文菜单
  6. 微信支付商户平台可以绑定多个不同主体的小程序或微信公众号
  7. 订单导出(淘宝天猫)
  8. Keras-训练网络时的问题:loss一直为nan,accuracy一直为一个固定的数
  9. 为用户“NT AUTHORITY/NETWORK SERVICE”授予的权限不足,无法执行此操作。 (rsAccessDenied)
  10. 基于51单片机的火焰报警器
  11. Bentley 软件公司 Acceleration Fund 宣布成立 Bentley 下属公司 Virtuosity
  12. 又是一年总结时-2007年总结及2008年计划
  13. 移动测试基础 Android 应用测试总结
  14. 51单片机的读写端口c语言,CH375_CH376 U盘读写模块在51单片机上的应用(原理图+测试程序+资料)...
  15. 基于java的springboot家政服务预约系统毕业设计springboot开题报告
  16. 数字信号处理(9)- 模拟信号的谱分析方法
  17. Hyperledger Fabric 1.2.1启用CouchDB作为状态数据库
  18. Linux发展历史大事编年表(截止2013年)
  19. 基于冯洛伊曼拓扑的鲸鱼算法用于滚动轴承的故障诊断研究(Matlab代码实现)
  20. Windows 系统配置 PHP 环境变量(PhpStudy集成环境)

热门文章

  1. 史上最详细单词记忆法!
  2. Ubuntu桌面美化(unity-tweak-tool)
  3. 11-6 商品库存和销量修改
  4. Windows查看进程占用并关闭进程
  5. WebService三大基本元素 SOAP WSDL UDDI
  6. NOI-1.3(14) 大象喝水
  7. 命令行与shell编程系列之什么是命令行
  8. 全球与中国微生物农药市场深度研究分析报告
  9. 用计算机如何工作判断函数单调性,函数单调性的常用判断方法及应用 - 范文中心...
  10. python 自动化测试框架_0——目录