系统 centos 7 64bit
1. 安装依赖软件
yum -y install policycoreutils openssh-server openssh-clients postfix
2.设置postfix开机自启,并启动,postfix支持gitlab发信功能
systemctl enable postfix && systemctl start postfix
3.下载gitlab安装包,然后安装
centos 6系统的下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6
centos 7系统的下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
我的是centos7,所以我在https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7中找了个gitlab-ce-10.8.4-ce.0.el7.x86_64.rpm版本,建议下载一个比较新的版本
下载rpm包并安装:
wget http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.8.4-ce.0.el7.x86_64.rpm
这里将https修改为http,不然会报错(无法验证 mirrors.tuna.tsinghua.edu.cn 的由 “CN=R3,O=Let's Encrypt,C=US” 颁发的证书: 颁发的证书已经过期)
安装rpm包时提示错误:依赖检测失败
rpm -ivh gitlab-ce-10.8.4-ce.0.el7.x86_64.rpm --nodeps --force
解决方法:命令末尾加上--nodeps --force
安装完成后出现上面的提示,按照提示修改配置文件中的url地址为本地服务器的地址
开始前,配置一个8899端口,重启防火墙 点击》》
firewall-cmd --zone=public --add-port=8899/tcp --permanent
firewall-cmd --reload
- 修改为没有使用的端口即可:
[root@gitlab tools]# vim /etc/gitlab/gitlab.rb
external_url 'http://192.168.171.129:8899' #根据需要修改端口
登录并进行基本操作
gitlab-ctl start #启动所有 gitlab 组件;
gitlab-ctl stop #停止所有 gitlab 组件;
gitlab-ctl restart #重启所有 gitlab 组件;
gitlab-ctl status #查看服务状态;
gitlab-ctl reconfigure #启动服务;
vim /etc/gitlab/gitlab.rb #修改默认的配置文件;
gitlab-rake gitlab:check SANITIZE=true --trace #检查gitlab;
gitlab-ctl tail #查看日志;
修改密码后进行登录,登录的用户名为root