1、确保你的linux服务器安装了sshd和ssh-client,并且sshd需要启动
基本都已经安装,如果没有装执行下面的命令
yum install openssh-server openssh-clients
systemctl start sshd
注:centos7以前的版本用:
service sshd start
2、安装curl和policycoreutils
yum install curl policycoreutils
3、放开端口提供web访问以及git clone(如果是云主机设置安全组放开端口即可;我的服务器上80端口被占用了,这里使用了8001端口)
firewall-cmd --permanent --add-port=8001/tcp
4、执行gitlab官方的安装准备脚本
curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
5、使用yum直接安装gitlab-ce
yum -y install gitlab-ce
注:我的服务器网络不是很好,yum下载gitlab-ce安装包的时候老是中断,不过最后也下载成功了。
如果你也有这种情况,建议你直接下载安装包,再拷贝到linux服务器上;下载地址https://packages.gitlab.com/gitlab/gitlab-ce/
6、安装完成后需要修改配置文件,例如web访问和git clone使用的url
vi /etc/gitlab/gitlab.rb
在文件中找到对应配置并修改(填写你的url)
external_url 'http://gitlab.xyztest.com:8001'
7、重新加载配置
gitlab-ctl reconfigure
8、启动
gitlab-ctl start