1. gitlab官方安装教程(基于centos7)
https://about.gitlab.com/install/#centos-7
sudo yum install -y curl policycoreutils-python openssh-serversudo systemctl enable sshdsudo systemctl start sshdsudo firewall-cmd --permanent --add-service=httpsudo firewall-cmd --permanent --add-service=httpssudo systemctl reload firewalldsudo yum install postfixsudo systemctl enable postfixsudo systemctl start postfixcurl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bashsudo EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ee
2. 官方教程存在的问题
- 默认安装的是gitlab-ee,不是gitlab-ce
- gitlab卸载后重装失败
3. gitlab-ce历史版本查看
https://packages.gitlab.com/gitlab/gitlab-ce
3-1. 自定义gitlab版本安装
sudo yum install -y curl policycoreutils-python openssh-serversudo systemctl enable sshdsudo systemctl start sshdsudo firewall-cmd --permanent --add-service=httpsudo firewall-cmd --permanent --add-service=httpssudo systemctl reload firewalldsudo yum install postfixsudo systemctl enable postfixsudo systemctl start postfixwget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-13.6.3-ce.0.el7.x86_64.rpm/download.rpmyum install -y gitlab-ce
4. 配置端口, 访问路径
gitlab默认端口是80和8080, 外界访问80端口,由nginx转发到8080端口访问gitlab
由于80端口和8080端口基本上都是要用到其他地方的, 所以这里需要调整gitlab的默认端口
# 修改gitlab.rb文件vi /etc/gitlab/gitlab.rb

external_url 我这里配的是域名,没有域名的直接配置IP就行
nginx[‘listen_port’] 修改默认的80端口为1081端口
unicorn[‘port’] 修改默认的8080端口为9126端口
5. 重启gitlab
gitlab-ctl stopgitlab-ctl reconfiguregitlab-ctl start
