参考:https://zhuanlan.zhihu.com/p/534072989
安装依赖包
- yum install policycoreutils openssh-server openssh-clients postfix
- systemctl enable sshd
- systemctl start sshd
- systemctl enable postfix
- systemctl start postfix
安装rpm包
- cd /usr/local/rpm
- wget https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/8/gitlab-ce-14.2.6-ce.0.el8.x86_64.rpm/download.rpm 下载安装包
- chown -R git:git /usr/local/rpm 将 /usr/local/rpm 目录及其所有子目录和文件的所有权更改为 git:git 用户和组
- 如果木有用户和目录则创建
- adduser git
- mkdir /usr/local/rpm
- rpm -ivh download.rpm 安装 RPM 软件包
修改配置文件
/etc/gitlab/gitlab.rb
external_url 'http://47.93.190.42:8080'
gitlib默认有nginx,如果是apatch服务器。需要额外配置以下内容。
nginx['enable'] = false
web_server['external_users'] = ['apache']
puma['listen'] = '0.0.0.0' //'127.0.0.1' "本地回环地址" 或 "localhost"
puma['port'] = 8080
配置防火墙
- firewall-cmd --permanent --add-service=http
- firewall-cmd --permanent --add-service=https
- systemctl reload firewalld
- firewall-cmd --zone=public --add-port=8080/tcp --permanent
- gitlab-ctl reconfigure
常用命令
gitlab-ctl start # 启动所有GitLab组件
gitlab-ctl stop # 停止所有GitLab组件
gitlab-ctl restart # 重启所有GitLab组件
gitlab-ctl status # 查看服务状态
gitlab-ctl reconfigure # 启动服务
gitlab-rake gitlab:check SANITIZE=true --trace # 检查GitLab
gitlab-ctl tail # 查看日志