赞
踩
本文内容以语雀为准
**git config --global http.sslVerify false**
禁用ssl的验证mkdir -p /etc/gitlab/ssl
cd /etc/gitlab/ssl
# 如果出现 -bash: openssl: command not found,请安装 openssl:yum -y install openssl
# 生成指定位数的 RSA 私钥:ca.key
openssl genrsa -out ca.key 2048
# 根据 RSA 私钥,生成 crt 证书:ca.crt
# CN:设置你要使用的域名
# -utf8:支持中文
openssl req -new -x509 -days 3650 -key ca.key -subj "/C=CN/ST=山东/L=青岛/O=徐晓伟工作室/OU=徐晓伟工作室/CN=192.168.80.14/emailAddress=xuxiaowei@xuxiaowei.com.cn" -out ca.crt -utf8
# openssl req -new -x509 -days 3650 -key ca.key -subj "/C=CN/ST=山东/L=青岛/O=徐晓伟工作室/OU=徐晓伟工作室/CN=gitlab.example.com/emailAddress=xuxiaowei@xuxiaowei.com.cn" -out ca.crt -utf8
# 生成 server.csr、server.key
# CN:设置你要使用的域名
# -utf8:支持中文
openssl req -newkey rsa:2048 -nodes -keyout server.key -subj "/C=CN/ST=山东/L=青岛/O=徐晓伟工作室/CN=192.168.80.14" -out server.csr -utf8
# openssl req -newkey rsa:2048 -nodes -keyout server.key -subj "/C=CN/ST=山东/L=青岛/O=徐晓伟工作室/CN=gitlab.example.com" -out server.csr -utf8
# 生成 ca.srl、server.crt
# subjectAltName:设置 DNS、IP
openssl x509 -req -extfile <(printf "subjectAltName=IP:192.168.80.14") -days 3650 -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt
# openssl x509 -req -extfile <(printf "subjectAltName=DNS:gitlab.example.com") -days 3650 -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt
yum -y install vim
vim /etc/gitlab/gitlab.rb
# 填写你的域名,注意是https
external_url 'https://192.168.80.14'
# external_url 'https://gitlab.example.com'
# 对应上方域名的证书
# 将证书放在 /etc/gitlab/ssl 文件夹中
nginx['ssl_certificate'] = "/etc/gitlab/ssl/server.crt"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/server.key"
# http 重定向到 https
nginx['redirect_http_to_https'] = true
# 禁用 Let's Encrypt 颁发证书
letsencrypt['enable'] = false
sudo gitlab-ctl reconfigure
sudo gitlab-ctl status
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。