1.安装GitLab-ce社区版
1.1 安装依赖关系
# sudo dnf install policycoreutils openssh-server postfix
1.2开启SSH并设置开机启动
# systemctl enable sshd
# systemctl start sshd
1.3开放系统防火墙的HTTP和HTTPS访问
# 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
1.4 配置Postfix邮件服务,设置开机启动
# sudo systemctl enable postfix
# sudo systemctl start postfix
1.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
1.6安装
# rpm -i gitlab-ce-13.1.1-ce.0.el8.x86_64.rpm
1.7修改配置文件
# vim /etc/gitlab/gitlab.rb
将下面这3行打开注释
unicorn['port'] = 8088
postgresql['shared_buffers'] = "256MB"
配置gitlab
# gitlab-ctl reconfigure
# gitlab-ctl start
完成编译后显示结果:
启动
1.8第一次登录需要修改root密码, 密码8位以上,修改完就可以登录
其他:
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 #查看版本