环境 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. JS——两个原生选择器

    1. document.querySlector() 2.document.querySlectorAll() <!DOCTYPE html> <html lang="en ...

  2. mac-profile

    Mac 中定义与Linux一样的profile.d 首先Mac是没有profile.d的 在/etc/profile文件中添加 for sh in /etc/profile.d/*sh; do [ - ...

  3. MongoDB Linux 安装配置 后台运行

    介绍安装的文档很多,可以参考这篇: http://www.mkyong.com/mongodb/how-to-install-mongodb-on-mac-os-x/ 安装完后你可能会碰到的2个问题. ...

  4. 使用Java生成带有下划线字体的文字

    HashMap<TextAttribute, Object> hm = new HashMap<TextAttribute, Object>(); hm.put(TextAtt ...

  5. windows系统下同时启动三台Tomcat服务的配置&并设置开机启动服务

    1.tomcat 7.0.82下载地址:链接:https://pan.baidu.com/s/1i51pAgl 密码:mxol 2.解压apache-tomcat-7.0.82-windows-x64 ...

  6. 前端Json数据模拟神器mockJs使用教程

    一般项目做法: <html> <head> <script src="http://requirejs.org/docs/release/2.1.16/comm ...

  7. 链接文字<a>保持原有的字体颜色

    <style type="text/css"> #red {color: red;} #blue {color: blue;} #orange {color: oran ...

  8. 使用FusionCharts创建可更新数据的JavaScript图表

    先创建一个简单的图表,然后改变它的数据(请参见下面的代码).图表最初据显示8月份的销售数据,当用户点击按钮时改为显示9月份的销售数据.每个月都有单独的XML文件,代码如下: <html> ...

  9. Spring MVC中注解的简介

    参考网址:  https://blog.csdn.net/a67474506/article/details/46361195 @RequestMapping映射请求 SpringMVC 使用 @Re ...

  10. Ajax的open方法

    Ajax的open()方法有3个参数:1.method:2.url:3.boolean: 参数1有get和post两个取值 参数2是表单的action属性值 参数3:boolean的取值 当该bool ...