1、我是在centos8下安装gitlab,但是这里我安装的时候用到了gitlab-ce对应的7版本,需要下载对应的8版本的
2、安装gitlab的时候版本一定要对应
3、参考链接
① centos8安装gitlab报错参考
② centos8安装gitlab方法参考
③ 参考笔记下载(我自己根据学习记录的)
4、安装步骤
4.0 安装GitLab-ce社区版
4.1 安装依赖关系
sudo dnf install policycoreutils openssh-server postfix
4.2 开启SSH并设置开机启动
systemctl enable sshd
systemctl start sshd
4.3 开放系统防火墙的HTTP和HTTPS访问(可以不用加 sudo)
sudo firewall-cmd --add-service=http --permanent
sudo firewall-cmd --add-service=https --permanent
sudo firewall-cmd --permanent --zone=public --add-port=8899/tcp
sudo firewall-cmd --permanent --zone=public --add-port=8088/tcp
sudo firewall-cmd --reload
4.4 配置Postfix邮件服务,设置开机启动
sudo systemctl enable postfix
sudo systemctl start postfix
4.5 下载gitlab
下载地址:
官网:https://packages.gitlab.com/gitlab/gitlab-ce/
清华大学镜像:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el8/
直接Cetnos8下载
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el8/gitlab-ce-13.1.1-ce.0.el8.x86_64.rpm
或通过Windows下载后上传至Cetnos
4.6 安装
rpm -ivh gitlab-ce-13.1.1-ce.0.el8.x86_64.rpm
4.7 初始化gitlab服务(我在这步,用了好久)
我使用 gitlab-ctl reconfigure 命令,运行了三次才成功,第一次用了一个小时左右,第二次用了30分钟左右,第三次用了1分多钟。
gitlab-ctl reconfigure
gitlab-ctl start
4.8 gitlab的登录
linux中安装的gitlab相当于服务器
windows中可以通过linux的ip地址或者计算机名称访问
① gitlab-server/
② 192.168.234.2/
浏览器直接输入上面的两个的任意一个然后回车就可以访问了
PS:
关于①的方式可以看一下下面的方法实现:
1)使用hostname命令查询linux的主机名
hostname
2)打开windows的下面的文件,在文件最后面添加linux的ip地址和主机名C:/windows/System32/drivers/etc/hosts
192.168.72.131 gitlab-serve
4.9 gitlab常用命令
gitlab-ctl start # 启动所有 gitlab 组件;
gitlab-ctl stop # 停止所有 gitlab 组件;
gitlab-ctl restart # 重启所有 gitlab 组件;
gitlab-ctl status # 查看服务状态;
vim /etc/gitlab/gitlab.rb # 修改gitlab配置文件;
gitlab-ctl reconfigure # 重新编译gitlab的配置;
gitlab-rake gitlab:check SANITIZE=true --trace # 检查gitlab;
gitlab-ctl tail # 查看日志;
gitlab-ctl tail nginx/gitlab_access.log
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION #查看版本