在Linux系统上安装GitLab的步骤如下:
sudo apt-get update
sudo apt-get upgrade
对于Ubuntu/Debian系统:
sudo apt-get install -y curl openssh-server ca-certificates tzdata perl
对于CentOS/RHEL系统:
sudo yum install -y curl policycoreutils-python openssh-server postfix
对于Ubuntu/Debian系统:
sudo systemctl enable openssh-server
sudo systemctl start openssh-server
对于CentOS/RHEL系统:
sudo systemctl enable postfix
sudo systemctl start postfix
对于Ubuntu/Debian系统(使用ufw):
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
对于CentOS/RHEL系统(使用firewalld):
sudo systemctl stop firewalld
sudo systemctl disable firewalld
sudo systemctl mask firewalld
sudo systemctl start firewalld
对于Ubuntu/Debian系统:
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
对于CentOS/RHEL系统:
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
对于Ubuntu/Debian系统:
sudo apt-get install -y gitlab-ce
对于CentOS/RHEL系统:
sudo yum install -y gitlab-ce
打开浏览器,访问 http://your_server_ip
,按照提示设置管理员密码并登录。
编辑 /etc/gitlab/gitlab.rb
文件,设置外部URL:
sudo vi /etc/gitlab/gitlab.rb
找到 external_url 'http://your_server_ip'
,修改为你的服务器IP地址或域名。
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart
现在,您可以通过Web浏览器访问您的GitLab服务器。在浏览器中输入服务器的IP地址或域名,例如:http://your_server_ip
。在第一次访问GitLab时,您需要设置管理员密码。
以上步骤是在Linux系统上安装GitLab的基本流程,具体操作可能会因Linux发行版和版本的不同而有所差异,建议参考GitLab官方文档或相关社区论坛获取更详细的安装指南。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>