CentOS7快速安装GitLab

1,安装依赖服务

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 systemctl reload firewalld

2,安装postfix发送通知邮件

sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix

3,安装GitLab

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash   
sudo EXTERNAL_URL="IP端口或域名" yum install -y gitlab-ee     

4,注意事项

在第二步安装 postfix 时,如果出现 找不到 libmysqlclient.so.18()(64bit) 这个错误,是因为缺少 Percona-XtraDB-Cluster-shared-55-5.5.37-25.10.756.el6.x86_64.rpm这个包,执行下面命令解决此问题。
wget http://www.percona.com/redir/downloads/Percona-XtraDB-Cluster/5.5.37-25.10/RPM/rhel6/x86_64/Percona-XtraDB-Cluster-shared-55-5.5.37-25.10.756.el6.x86_64.rpm
rpm -ivh Percona-XtraDB-Cluster-shared-55-5.5.37-25.10.756.el6.x86_64.rpm

由于GitLab服务器默认使用的8080端口,所以如果你的8080端口已被使用则需要修改端口。

修改 /etc/gitlab/gitlab.rb       unicorn['port'] = 未使用端口

重启服务 sudo gitlab-ctl reconfigure

5,启动GitLab

浏览器访问上面EXTERNAL_URL设置的地址进入初始密码设置页面,设置完成后进入登录页面,管理员默认账号为 root。


参考文档:  GitLab官方文档