centos7 安装gitlab任意版本

时间:2023-03-09 06:02:11
centos7 安装gitlab任意版本

主要还是根据官网:https://www.gitlab.cc/installation/#centos-7

1.安装依赖:

sudo yum install curl policycoreutils openssh-server openssh-clients
sudo systemctl enable sshd
sudo systemctl start sshd
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld

  

2.安装gitlab:

curl -LJO https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-XXX.rpm
rpm -i gitlab-ce-XXX.rpm

 这里gitlab-ce-XXX.rpm 根据你的需要安装需要的版本,如果服务器配置比较低就安装低点的版本。

自己可以在https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/  中挑选。

比如我:

curl -LJO https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-7.14.3-ce.1.el7.x86_64.rpm
rpm -i gitlab-ce-7.14.3-ce.1.el7.x86_64.rpm
  

  安装了第一步的依赖后你就可以任意安装自己需要的版本的gitlab了,本人试过最新版的硬件要求比较高,所以如果你的内存只要1g,或更小就需要安装低版本的gitlab了,估计7多的版本吧,8不知道可不可以,没试过,不过7可以。

3.最后就是启动了:

sudo gitlab-ctl reconfigure

  

4.如果你需要修改端口和访问的ip或地址的话:

# find / -name gitlab.yml
/opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
/var/opt/gitlab/gitlab-rails/etc/gitlab.yml
gitlab.yml可以修改host和端口:

centos7 安装gitlab任意版本

修改之后,还需要再启动一次,不过这次需要:

gitlab-ctl restart

  就可以了。