1. gitlab官方安装教程(基于centos7)
https://about.gitlab.com/install/#centos-7
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 firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
sudo 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-server
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-13.6.3-ce.0.el7.x86_64.rpm/download.rpm
yum 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 stop
gitlab-ctl reconfigure
gitlab-ctl start