下面给你一份在 CentOS 上部署 GitLab(CE 社区版)的常用、稳妥方案,适合服务器直接安装(Omnibus 包),也是官方推荐方式。
# 关闭 SELinux(或设为 permissive)
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
# 防火墙
systemctl stop firewalld
systemctl disable firewalld
yum install -y curl policycoreutils openssh-server postfix
systemctl enable sshd
systemctl start sshd
systemctl enable postfix
systemctl start postfix
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | bash
EXTERNAL_URL="http://gitlab.example.com" yum install -y gitlab-ce
如果是内网 IP:
EXTERNAL_URL="http://192.168.1.100" yum install -y gitlab-ce
vi /etc/gitlab/gitlab.rb
常见修改:
external_url 'http://192.168.1.100'
gitlab-ctl reconfigure
gitlab-ctl start
gitlab-ctl stop
gitlab-ctl restart
gitlab-ctl status
http://服务器IP
首次登录:
rootcat /etc/gitlab/initial_root_password
修改:
external_url 'http://192.168.1.100:8080'
nginx['listen_port'] = 8080
然后:
gitlab-ctl reconfigure
gitlab-rake "gitlab:password:reset[root]"
gitlab-rake gitlab:backup:create
如果你更想用 Docker:
docker run -d \
--hostname gitlab.example.com \
-p 8080:80 \
-v /srv/gitlab:/etc/gitlab \
gitlab/gitlab-ce
/var/opt/gitlab如果你告诉我:
我可以给你定制版部署方案。