Linux环境下配置GitLab一般有以下步骤:
sudo apt update
和sudo apt install -y curl openssh-server ca-certificates postfix
;CentOS/RHEL系统用sudo yum install -y curl policycoreutils-python openssh-server
,并启动SSH服务。curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
;CentOS/RHEL执行curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
。EXTERNAL_URL
指定域名或IP,如sudo EXTERNAL_URL="http://gitlab.example.com" apt install gitlab-ce
(Ubuntu/Debian)或sudo EXTERNAL_URL="http://gitlab.example.com" yum install gitlab-ce
(CentOS/RHEL)。/etc/gitlab/gitlab.rb
文件,修改external_url
等配置,如external_url 'http://gitlab.example.com'
,然后执行sudo gitlab-ctl reconfigure
应用配置。sudo gitlab-ctl start
启动GitLab服务,也可设置开机自启sudo systemctl enable gitlab
。sudo ufw allow http
、sudo ufw allow https
和sudo ufw allow ssh
;CentOS/RHEL用sudo firewall-cmd --permanent --add-service={http,https,ssh}
和sudo firewall-cmd --reload
。