1、上传
将gitlab-ce-13.6.1-ce.0.el7.x86_64.rpm软件上传到/root文件夹中,
下载地址:Index of /gitlab-ce/yum/el7/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-13.6.1-ce.0.el7.x86_64.rpm2、安装
然后执行如下命令(详情请参考gitlab安装记录):
yum -y install policycoreutils openssh-clients postfix systemctl enable sshd & sudo systemctl start sshd systemctl enable postfix && systemctl start postfix yum -y install policycoreutils-python rpm -i gitlab-ce-13.6.1-ce.0.el7.x86_64.rpm3、修改配置文件
vim /etc/gitlab/gitlab.rb
修改默认的配置文件把这个external_url 'http://gitlab.example.com' 改成服务器ip
新建路径(作为数据存储路径,此步骤可以不执行采用默认路径(/var/opt/gitlab/git-data/),改为新路径:/home/datas/gitlab-data/
修改 /etc/gitlab/gitlab.rb配置文件 583行
git_data_dirs({
"default" => {
"path" => "/home/datas/gitlab-data"
}
})
4、使配置生效
gitlab-ctl reconfigure5、启动gitlab
gitlab-ctl restart6、验证
netstat -tunlp7、修改端口号(可选)
将默认80访问端口改成5023修改文件/etc/gitlab/gitlab.rb第1311行代码
/var/opt/gitlab/nginx/conf/gitlab-http.conf35行listen *:80 改为listen *:5023
重启
gitlab-ctl restart