Gitlab安装配置管理
◆安装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安装配置管理的更多相关文章
- GitLab安装说明
GitLab,是一个使用 Ruby on Rails 开发的开源应用程序,与Github类似,能够浏览源代码,管理缺陷和注释,非常适合在团队内部使用. gitlab是基于Ruby on Rails的, ...
- Gitlab安装、汉化及使用
环境:centos 关闭防火墙和selinux [root@Gitlab ~]# setenforce [root@Gitlab ~]# service iptables stop && ...
- git\CentOS6.5中gitlab安装教程
一.Git 起源: Git是一个开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目. Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本 ...
- Ubuntu gitlab安装文档及邮件通知提醒配置
1.安装依赖包,运行命令 sudo apt-get install curl openssh-server ca-certificates postfix 2.由于gitlab官方源可能被“墙”,首先 ...
- gitlab安装随记
gitlab安装 配置yum源 sudo vim /etc/yum.repos.d/gitlab-ce.repo 按照网上别人的例子,修改为清华的源 [gitlab-ce] name=Gitlab C ...
- CentOS 7 环境下GitLab安装及基本配置
新实验室要求重新建设GitLab,对于我来讲,是第一次有机会当元老参与实验室的建设.下面分享我自己的实测经验: 1. 安装依赖软件并设置开机启动 yum install curlpolicycoreu ...
- GitLab安装及使用
GitLab是一个利用 Ruby on Rails 开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目. GitLab拥有与Github类似的功能,能够浏览 ...
- gitlab之一: gitlab安装配置使用
参考: gitlab 安装和配置 gitlab下载地址: https://mirror.tuna.tsinghua.edu.cn/gitlab-ce/ 官方教程: https://about.gitl ...
- Gitlab安装以及汉化
Gitlab安装以及汉化 系统环境: CentOS 7.5 IP:192.168.1.2 关闭selinux.firewalld gitlab-ce-10.8.4 rpm包:下载地址 一.下载并安装g ...
随机推荐
- H3C 路由环路
- windows服务器运维日常--防火墙打开后ping不通
1. 打开防火墙,有利于安全 2. 添加80端口,支持互联网访问:添加3389端口,以支持远程桌面连接 3. 发现开了防火墙之后,ping不通网址www.mjywxy.xin 4. 查找资料和测试发现 ...
- P1053 第K小的取法
题目描述 给定一个含n个数的数组.现在从中取出一些数.并把这些数相加得出一个和,如果有多种取法的和相同,则视为多种取法.求所有取法对应的和中第K小的和. 输入格式 第一行包括两个正整数n(n<= ...
- windows环境下pgsql的安装与使用
- 备战省赛组队训练赛第六场(UPC)
传送门 外来博客题解1:戳这里 外来博客题解2:戳这里 CRWG全方位题解:戳这里
- 树莓派4安装net core3.0环境
树莓派4官方系统是32系统,所以需要安装arm32版本的net core sk和runtime 1,首先创建一个文件夹 dotnet-arm32 sudo mkdir dotnet arm32 2,下 ...
- python3 实现删除数组中相同的元素
# #把数组中相同的元素去除 # #第一种方式: def del_repeatnum(s=[1,1,1,2,2,3,3,4]): s1=[] for i in s: print(i) if i not ...
- shelve模块、re模块
在模糊匹配时使用 1
- Centos 7.5安装 Mysql5.7.24
1. 下载 MySQL 本文采用的Linux为是腾讯云 标准型S2 (1 核 1 GB) Centos 7.5 64位 1.1 官网下载地址: https://dev.mysql.com/downl ...
- 使用 Postman 测试你的 API
使用 Postman 测试你的 API Intro 最近想对 API 做一些自动化测试,看了几个工具,最后选择了 postman,感觉 postman 的设计更好一些,我们可以在请求发送之前和请求获取 ...