环境 lunix(ubuntu)

  1:添加文件

    在   /etc/apt/sources.list.d/gitlab-ce.list  中添加一行

     deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu trusty main

   (Ubuntu16中添加这个 deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu xenial main )

  

  2:开始安装

    sudo apt-get update

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

    sudo apt-get install -y postfix

    (输入一个邮箱)

    sudo apt-get install gitlab-ce

  3:修改配置

    /etc/gitlab/gitlab.rb 中修改

    external_url  (如 : external_url 'http://git.home.com')    外部访问的链接

    设置为false后安装过程不会自动清理缓存(比较耗时):

     gitlab_rails['rake_cache_clear'] = false

  可以修改其他项

gitlab_rails['rack_attack_git_basic_auth'] = {

    'enabled' => true,

    'ip_whitelist' => ["127.0.0.1","Gitlab部署的IP地址"],

    'maxretry' => 300, //最大错误数

    'findtime' => 60, //60秒后重新计数

    'bantime' => 60 //达到错误数后,屏蔽IP 60秒

}

  

  4:备份配置

参考文档:https://www.cnblogs.com/kevingrace/p/7821529.html

  修改配置文件   sudo vim /etc/gitlab/gitlab.rb

   修改配置:

 gitlab_rails['manage_backup_path'] = true

  gitlab_rails['backup_path'] = "/data/gitlab/backups" //gitlab备份目录

  gitlab_rails['backup_archive_permissions'] = 0644 //生成的备份文件权限

  gitlab_rails['backup_keep_time'] = 7776000 //备份保留天数为3个月(即90天,这里是7776000秒)

  保存修改。

  

  创建备份连路径:

     mkdir -p /data/gitlab/backups

     chown -R git.git /data/gitlab/backups

     chmod -R 777 /data/gitlab/backups

重新启动,让配置生效

  

sudo gitlab-ctl reconfigure

  

  访问域名:

  备份与还原

  1:备份    gitlab-rake gitlab:backup:create

   2:还原

     停止服务:

 gitlab-ctl stop unicorn gitlab-ctl stop sidekiq

  进入备份的文件夹,还原需要的备份

 gitlab-rake gitlab:backup:restore BACKUP=1510472027_2017_11_12_9.4.5 -- 备份文件名的时间戳前缀

  

3;重新启动

 gitlab-ctl start

  

  4:检查恢复情况

gitlab-rake gitlab:check SANITIZE=true

  

  5:定时备份

  

sudo crontab -e 0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1

  

注:

# 启动Gitlab所有组件
sudo gitlab-ctl start # 停止Gitlab所有组件
sudo gitlab-ctl stop # 重启Gitlab所有组件
sudo gitlab-ctl restart

gitLab 服务器搭建 (自己服务器上搭建gitLab)的更多相关文章

  1. 在阿里云 CentOS 服务器(ECS)上搭建 nginx + mysql + php-fpm 环境

    阿里云的云服务器(ECS)可以选择多种操作系统,打算用它运行 Drupal或者 WordPress ,你最好选择 Linux 系统,这篇文章的演示是基于阿里云的 CentOS 操作系统的服务器.我们在 ...

  2. (转)在阿里云 CentOS 服务器(ECS)上搭建 nginx + mysql + php-fpm 环境

    阿里云的云服务器(ECS)可以选择多种操作系统,打算用它运行 Drupal或者 WordPress ,你最好选择 Linux 系统,这篇文章的演示是基于阿里云的 CentOS 操作系统的服务器.我们在 ...

  3. caffe搭建--opensuse13.2上搭建caffe开发环境

    第一部分:参考一下内容.将sudo 替换成zypper即可. --------------------------------------------这部分参照以下官网内容-------------- ...

  4. Oracle_lhr_CentOS 7.3 ECS上搭建RAC 18c+单实例DG+EMCC+DG的FSFO快速故障转移配置

    Oracle_lhr_CentOS 7.3  ECS上搭建RAC 18c+单实例DG+EMCC+DG的FSFO快速故障转移配置 [大型连续免费公开课]Oracle 18c rac+dg+13.3的em ...

  5. CentOS服务器上搭建Gitlab安装步骤、中文汉化详细步骤、日常管理以及异常故障排查

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

  6. centos6.5上搭建gitlab服务器(亲测可用哦)

    最近的版本控制中,git可谓是脱缰的野马,一发不可收拾.当然git的设计模式也是愈发的成熟,让人刮目相看,完美解决了svn上的不足之处.在目前分布式横行的天下,git可谓是占得了一席之地. 废话少说, ...

  7. 在centos服务器上配置gitlab钩子引发的一系列问题

    为了给公司的服务器上搭建gitlab环境并且配置钩子(实现在本地git push之后服务器自动git pull),整了好久,最后终于把问题解决了,下面是记录安装gitlab之后引发的一系列问题: 首先 ...

  8. 在自己的服务器上部署 GitLab 社区版

    GitLab 简介 因为我的个人网站 restran.net 已经启用,博客园的内容已经不再更新.这篇文章是在 Gitlab 7.4 的环境下配置的,相关内容可能已经过时. 后续做了一次迁移,将 Gi ...

  9. 在UP Board 上搭建M——L服务器

    前言 原创文章,转载引用务必注明链接,水平有限,欢迎指正. 本文环境:ubilinux 3.0 on UP Board 初识免流 所谓免流,就是免除手机访问网络产生的流量费用.其原理在乌云网上有过报道 ...

随机推荐

  1. 转 nagios监控oracle运行状况

    https://blog.csdn.net/heizistudio/article/details/8638488 nrpe安装脚本 nagios-plugins-1.4.13.tar.gznrpe- ...

  2. CodeForces - 93B(贪心+vector<pair<int,double> >+double 的精度操作

    题目链接:http://codeforces.com/problemset/problem/93/B B. End of Exams time limit per test 1 second memo ...

  3. json java simple-json

    http://code.google.com/p/json-simple/wiki/EncodingExamples#Example_1-1_-_Encode_a_JSON_object javac ...

  4. ruby firefox23报错:waiting for evaluate.js load failed

    解决方法 gem install selenium-webdriver -v='2.34.0'

  5. DNS跳转

    switch (window.location.hostname) { case "www.zcom.gov.cn" ://确定域名为 www.zcom.gov.cn //wind ...

  6. C#对INI文件读写

    C#本身没有对INI格式文件的操作类,可以自定义一个IniFile类进行INI文件读写. using System; using System.Collections.Generic; using S ...

  7. orcale错题分析

    删除同义词语法正确的是: Drop  synonym sy nonym_name; 关于Oracle创建间隔分区后,正确的是: 使用partition(分区名)可以查看特定分区内存放的表记录 关于序列 ...

  8. 【翻译转载】【官方教程】Asp.Net MVC4入门指南(2):添加一个控制器

    2. 添加一个控制器 · 原文地址:http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-c ...

  9. 关于安卓visualizer的用法

    看别人显示播放wav文件显示频谱写的代码都是断断续续的,在这里我贴了完整的代码,给有需要的人做参考,显示频谱还没有完成,不知道怎么弄,已经可以得到byte[] fft数据了,参考别人的写法也可以开方取 ...

  10. Sometimes it takes going through something so awful to realize the beauty that is out there in this world.

    Sometimes it takes going through something so awful to realize the beauty that is out there in this ...