在CentOS上部署GitLab的步骤如下:
安装前准备
- 更新系统:
sudo yum update
- 安装依赖包:
sudo yum install -y curl openssl-devel policycoreutils-python openssh-server perl git nodejs rsync cronie postfix
- 配置SSH服务:
sudo systemctl enable sshd sudo systemctl start sshd
- 配置防火墙:
sudo firewall-cmd --permanent --add-service=https sudo firewall-cmd --permanent --add-service=ssh sudo firewall-cmd --reload
安装GitLab
- 下载GitLab安装包:
cd ~ && sudo yum install -y wget sudo wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-17.3.1-ce.0.el7.x86_64.rpm/download.rpm
- 安装GitLab:
sudo rpm -ivh gitlab-ce-17.3.1-ce.0.el7.x86_64.rpm
配置GitLab
- 重新配置GitLab:
sudo gitlab-ctl reconfigure
- 启动GitLab服务:
sudo gitlab-ctl start
- 设置GitLab开机自启:
sudo systemctl enable gitlab
访问GitLab
现在,您可以通过浏览器访问GitLab的Web界面。通常,您可以在浏览器中输入服务器的IP地址或域名,以及GitLab默认的端口号80(或您自定义的端口号)。
请注意,上述步骤可能因GitLab版本和具体需求而有所不同。建议参考GitLab的官方文档以获取最准确和最新的安装指南。