◆安装Gitlab前系统预配置准备工作
1.关闭firewalld防火墙
# systemctl stop firewalld
# systemctl disable firewalld

2.关闭SELINUX并重启系统
#:wq
SEL INUX=disabled
# reboot

# getenforce (查看策略是否被禁用)

◆安装Omnibus Gitlab-ce package
1.安装Gitlab组件
# yum -y install curl policycoreutils openssh-server openssh-clients postfix
2.配置YUM仓库
# curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

3.启动postfix邮件服务
# systemctl start postfix

# systemctl enable postfix
4.安装Gitlab-ce社区版本
# yum install -y gitlab-ce

◆Omnibus Gitlab等相关配置初始化并完成安装
1.证书创建与配置加加载

#mkdir -p /etc/gitlab/ssl    (手动创建ssl目录)

#openssl genrsa -out "/etc/gitlab/ssl/gitlab.example.com.key" 2048(创建一个本地的私有秘钥)
#cd /etc/gitlab/ssl

#openssl req -new -key "/etc/gitlab/ssl/gitlab.example.com.key" -out "/etc/gitlab/ssl/gitlab.example.com.csr"(创建私有证书)

这时候已经进入到csr证书,安装向导界面

#cn

#bj

#bj

然后输入2次空格

如果输入gitlab的域名

# gitlab.example.com

然后输入邮箱地址

#admin@example.com

然后输入证书密码

然后回车安装完成,使用   ll /etc/gitlab/ssl/ 查看证书是否创建成功

创建crt签署证书

#openssl x509 -req -days 365 -in "/etc/gitlab/ssl/gitlab.example.com.csr" -signkey "/etc/gitlab/ssl/gitlab.example.com.key" -out "/etc/gitlab/ssl/gitlab.example.com.crt"

#ll /etc/gitlab/ssl/(查看是否创建成功)

创建pem证书

#openssl dhparam -out /etc/gitlab/ssl/dhparams.pem 2048

更改所有证书的权限

#cd /etc/gitlab/ssl/

#chmod 600 *

配置gitlab的文件,将所有生产证书,配置到文件中

#vi /etc/gitlab/gitlab.rb

external_url 'http://gitlab.example.com'
external_url 'https://gitlab.example.com' # 修改成https #nginx['redirect_http_to_https'] = false
nginx['redirect_http_to_https'] = ture #去掉注释 false改成ture # nginx['ssl_certificate'] = "/etc/gitlab/ssl/#{node['fqdn']}.crt"
# nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.example.com.crt" # 更改路径 # nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/#{node['fqdn']}.key"
# nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.example.com.key" # 更改路径 # nginx['ssl_dhparam'] = nil # Path to dhparams.pem, eg. /etc/gitlab/ssl/dhparams.pem
# nginx['ssl_dhparam'] = /etc/gitlab/ssl/dhparams.pem # Path to dhparams.pem, eg. /etc/gitlab/ssl/dhparams.pem #添加证书路径

初始化相关配置

#gitlab-ctl reconfigure ​

2.Nginx SSL代理服务配置

配置nginx。修改配置http配置文件

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

rewrite ^(.*)$ https://$host$1 permanent;  #添加此行,用来重定向配置http请求。如下

server {
listen *:80; server_name gitlab.example.com;
rewrite ^(.*)$ https://$host$1 permanent;
server_tokens off; ## Don't show the nginx version number, a security best practice

使nginx配置生效

#gitlab-ctl restart

3.初始化Gitlab相关服务并完成安装

在本地电脑上配置hosts

192.168.96.188 gitlab.example.com

在浏览器中访问 gitlab.example.com

​​

设置管理员密码后。

登录默认账号root

​​

使用创建新的仓库 test-repo

​​

创建完后复制地址

​​

打开git Bash

在本地d盘创建一个目录

#cd d:

#mkdir repo
#cd repo/

​​

克隆
#git -c http.sslVerify=false clone https://gitlab.example.com/root/test-repo.git

#cd test-repo/

​​

创建一个程序,添加多本地

# vi test.py

# git add .

​​

连接
# git commit -m"First commit"

需要创建一个全局用户名

#git config --global user.email "289900168@qq.com"

#git config --global user.email "admin"

​​

再次连接

#git commit -m"first commit"

推送

#git -c http.sslVerify=false push origin master

​​

访问gitlab.example.com/root/test-repo  。上传成功

​​

Gitlab安装配置管理的更多相关文章

  1. GitLab安装说明

    GitLab,是一个使用 Ruby on Rails 开发的开源应用程序,与Github类似,能够浏览源代码,管理缺陷和注释,非常适合在团队内部使用. gitlab是基于Ruby on Rails的, ...

  2. Gitlab安装、汉化及使用

    环境:centos 关闭防火墙和selinux [root@Gitlab ~]# setenforce [root@Gitlab ~]# service iptables stop && ...

  3. git\CentOS6.5中gitlab安装教程

    一.Git 起源: Git是一个开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目. Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本 ...

  4. Ubuntu gitlab安装文档及邮件通知提醒配置

    1.安装依赖包,运行命令 sudo apt-get install curl openssh-server ca-certificates postfix 2.由于gitlab官方源可能被“墙”,首先 ...

  5. gitlab安装随记

    gitlab安装 配置yum源 sudo vim /etc/yum.repos.d/gitlab-ce.repo 按照网上别人的例子,修改为清华的源 [gitlab-ce] name=Gitlab C ...

  6. CentOS 7 环境下GitLab安装及基本配置

    新实验室要求重新建设GitLab,对于我来讲,是第一次有机会当元老参与实验室的建设.下面分享我自己的实测经验: 1. 安装依赖软件并设置开机启动 yum install curlpolicycoreu ...

  7. GitLab安装及使用

    GitLab是一个利用 Ruby on Rails 开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目. GitLab拥有与Github类似的功能,能够浏览 ...

  8. gitlab之一: gitlab安装配置使用

    参考: gitlab 安装和配置 gitlab下载地址: https://mirror.tuna.tsinghua.edu.cn/gitlab-ce/ 官方教程: https://about.gitl ...

  9. Gitlab安装以及汉化

    Gitlab安装以及汉化 系统环境: CentOS 7.5 IP:192.168.1.2 关闭selinux.firewalld gitlab-ce-10.8.4 rpm包:下载地址 一.下载并安装g ...

随机推荐

  1. Python--day32--struct模块定制报头理论(什么是网络协议?网络协议的本质是什么?)

  2. H3C FTP其他常用命令

  3. The call() and apply() Mtheods

    Example 6-4function classof(o) {     if (o === null) return "Null";     if (o ===undefined ...

  4. H3C VLAN配置示例

  5. linux ioctl 接口

    大部分驱动需要 -- 除了读写设备的能力 -- 通过设备驱动进行各种硬件控制的能力. 大 部分设备可进行超出简单的数据传输之外的操作; 用户空间必须常常能够请求, 例如, 设 备锁上它的门, 弹出它的 ...

  6. H3C配置Header进入用户视图的提示信息--系统视图

                      incoming:登录终端用户界面时的提示信息. Header 3种类型     login:登录验证时的提示信息.    Vty模式                ...

  7. Linux 内核热插拔事件产生

    一个热插拔事件是一个从内核到用户空间的通知, 在系统配置中有事情已经改变. 无论何 时一个 kobject 被创建或销毁就产生它们. 这样事件被产生, 例如, 当一个数字摄像头 使用一个 USB 线缆 ...

  8. 手把手教你用ngrx管理Angular状态

    本文将与你一起探讨如何用不可变数据储存的方式进行Angular应用的状态管理 :ngrx/store——Angular的响应式Redux.本文将会完成一个小型简单的Angular应用,最终代码可以在这 ...

  9. 【土旦】vue 解决ios H5底部输入框 获取焦点时弹出虚拟键盘挡住输入框 以及监听键盘收起事件

    问题描述 im聊天H5页面,在iOS系统下,inpu获取焦点弹出系统虚拟键盘时,会出现挡住input的情况,十分影响用户体验. bug图 解决方法: html: <input type=&quo ...

  10. JQuery仿购物网站放大镜特效所遇问题及思考

    JQuery仿购物网站放大镜特效所遇问题及思考 先贴下效果图,然后描述起来也就不会不知道我在说什么了. 我碰到的问题一: 一开始我自己总结了是因为两个小原因导致的①使用了mouseover,mouse ...