系统要求:
支持的Linux发行版:
sudo apt-get update
sudo apt-get install -y curl openssh-server ca-certificates postfix
在Postfix安装过程中,选择"Internet Site"并设置您的服务器域名。
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
sudo EXTERNAL_URL="https://gitlab.example.com" apt-get install gitlab-ee
将gitlab.example.com
替换为您实际的域名或服务器IP地址。
sudo ufw allow http
sudo ufw allow https
sudo ufw allow OpenSSH
sudo ufw enable
运行以下命令重新配置GitLab:
sudo gitlab-ctl reconfigure
安装完成后,在浏览器中访问您设置的EXTERNAL_URL(如https://gitlab.example.com
)。
首次访问时,系统会提示您设置root用户的密码。
sudo yum install -y curl policycoreutils-python openssh-server
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
sudo EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ee
主配置文件位于/etc/gitlab/gitlab.rb
,修改后需要运行:
sudo gitlab-ctl reconfigure
sudo gitlab-ctl start
sudo gitlab-ctl stop
sudo gitlab-ctl restart
sudo gitlab-ctl status
创建备份:
sudo gitlab-rake gitlab:backup:create
恢复备份:
sudo gitlab-rake gitlab:backup:restore BACKUP=备份文件名
如需更详细的配置或遇到问题,可以参考GitLab官方文档。