omnibus gitlab-ce安装

Posted aubin

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了omnibus gitlab-ce安装相关的知识,希望对你有一定的参考价值。

技术分享图片

架构

技术分享图片

关闭防火墙

[[email protected] ~]# systemctl stop firewalld
[[email protected] ~]# systemctl disable firewalld

关闭SELinux

[[email protected] ~]# setenforce 0
setenforce: SELinux is disabled

安装依赖组件

[[email protected] ~]# yum -y install curl policycoreutils openssh-server openssh-clients postfix

下载gitlab-ce仓库

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

启动邮件服务器

[[email protected] data]# systemctl start postfix
[[email protected] data]# systemctl enable postfix

安装gitlab

安装omnibus gitlab-ce
omnibus相当于一键安装包,自动安装gitlab所依赖的所有组件

 yum -y install gitlab-ce

创建私钥与证书

[[email protected] data]# mkdir /etc/gitlab/ssl
[[email protected] data]# openssl genrsa -out "/etc/gitlab/ssl/gitlab.aubin.com.key" 2048


创建申请证书
openssl req -new -key "/etc/gitlab/ssl/gitlab.aubin.com.key" -out "/etc/gitlab/ssl/gitlab.aubin.com.csr
Country Name (2 letter code) [XX]:cn                # 国家
State or Province Name (full name) []:bj            # 省份
Locality Name (eg, city) [Default City]:bj          # 城市
Organization Name (eg, company) [Default Company Ltd]:ctyun # 公司名
Organizational Unit Name (eg, section) []:ops       # 部门
Common Name (eg, your name or your server's hostname) []:gitlab.aubin.com
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:


给申请证书签名
[[email protected] data]# openssl x509 -req -days 3650 -in "/etc/gitlab/ssl/gitlab.aubin.com.csr" -signkey "/etc/gitlab/ssl/gitlab.aubin.com.key" -out "/etc/gitlab/ssl/gitlab.aubin.com.crt"

创建pem
openssl dhparam -out /etc/gitlab/ssl/dhparams.pem 2048
 
修改权限
chmod 600 /etc/gitlab/ssl/*

配置gitlab

nginx['redirect_http_to_https'] = ture
nginx['ssl_client_certificate'] = "/etc/gitlab/ssl/gitlab.aubin.com.crt"
nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.aubin.com.crt"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.aubin.com.key"
nginx['ssl_dhparam'] = "/etc/gitlab/ssl/dhparams.pem"
nginx['listen_addresses'] = ['*']
nginx['listen_port'] = 9000

初始化所有配置

[[email protected] ssl]# gitlab-ctl reconfigure

配置本地windows住的hosts文件

# gitlab
42.81.133.59 gitlab.aubin.com

浏览器访问

初次进入需要设置管理员密码(默认账号为root),前面配置了nginx为https访问,所以访问地址应该为https

https://IP:9000

技术分享图片

nginx配置文件

修改配置文件后要重启gitlabgitlab-ctl restart

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

以上是关于omnibus gitlab-ce安装的主要内容,如果未能解决你的问题,请参考以下文章

Docker-安装GitLab

Gitlab安装备份与恢复

gitlab+jenkins+webhook 代码发布

GitLab中文社区版Docker镜像安装启动及配置

Start a new Gitlab-CE

docker 安装使用gitlab