安装GithLab
1. 安装必要依赖
sudo yum install -y curl policycoreutils-python openssh-server perl
sudo systemctl enable sshd
sudo systemctl start sshd
# 开启 http 端口:GitLab 默认端口
# 开启 https 端口:GitLab 默认端口
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
# 重载防火墙
sudo systemctl reload firewalld
# 查看防火墙已开放的端口与服务
sudo firewall-cmd --list-all
2. 配置GitLab软件源镜像
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
3. 下载安装GitLab
sudo EXTERNAL_URL="http://192.168.0.180" yum install -y gitlab-ee
出现如图表示安装成功,可能需要多等几分钟
4. 查看管理员root用户默认密码
# 用户名为 root
sudo cat /etc/gitlab/initial_root_password
5. 登录GitLab
登录地址:http://192.168.0.180/users/sign_in
6. 修改密码
http://192.168.0.180/-/profile/password/edit
7. GitLab就安装完成了
8. 相关命令
#查看GItLab状态
sudo systemctl status gitlab-runsvdir.service
#停止GitLab
sudo systemctl stop gitlab-runsvdir.service
#GitLab开机自启状态
sudo systemctl list-unit-files | grep gitlab-runsvdir.service
#关闭GitLab开机自启动
sudo systemctl disable gitlab-runsvdir.service
#开启GitLab开机自启动
sudo systemctl enable gitlab-runsvdir.service
#查看GitLab各服务状态
sudo gitlab-ctl status