搭建独立代码平台,最新版本!
机器server:192.168.203.10
机器client: 192.168.203.20
关闭防火墙和selinux:systemctl stop firewalld、setenforce 0
一、机器server的操作:
配置yum源:
vim /etc/yum.repo.d/gitlab-ce.repo
- [gitlab-ce]
- name=Gitlab CE Repository
- baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever
- gpgcheck=0
- enabled=1
安装依赖:
yum install -y curl policycoreutils-python openssh-server postfix #postifx邮箱服务
systemctl start postifx #启动邮箱
安装gitlab:
本次时间会很长,等待。。。
yum -y install gitlab-ce
二、配置gitlab登录
vim /etc/gitlab/gitlab.rb
设置地区时间:
设置ip #本次是修改为机器ip
去掉数据路径的注释
开启ssh服务
三、初始化Gitlab,时间长
gitlab-ctl reconfigure
四、启动Gitlab服务
gitlab14版本以上会有默认root用户,密码存在/etc/gitlab/initial_root_password
五、gitlab设置HTTPS方式
- 如果想要以上的 https 方式正常生效使用,则需要把 letsencrypt 自动生成证书的配置打开,这样在执行重
- 新让配置生效命令 (gitlab-ctl reconfigure) 的时候会自动给域名生成免费的证书并自动在 gitlab 自带的
- nginx 中加上相关的跳转配置,都是全自动的,非常方便。
- letsencrypt['enable'] = true
- letsencrypt['contact_emails'] = ['caryyu@qq.com'] # 这应该是一组要添加为联系人的电子邮件地址
六、访问测试并修改密码