在CentOS8上搭建最新版本的Redmine和GitLab。搭建GitLab

構建GitLab

在本文中,我们以官方的Linux软件包(推荐安装)为基础,在CentOS8上构建最新版本的GitLab。

ソフトウェア バージョン OS CentOS 8.3 gitlab-ee 13.9.4-ee.0.el8

相关文章

“在CentOS8上搭建最新版本的Redmine和GitLab”-“Redmine的建立”

1.安装和配置依赖包。

[doshi@centos8 ~]$ sudo dnf install -y curl policycoreutils openssh-server perl

2. 安装Omnibus GitLab包

将GitLab软件包添加到代码库。

[doshi@centos8 ~]$ sudo curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash

查看存储库时,发现已添加gitlab_gitlab-ee。

[doshi@centos8 ~]$ dnf repolist
repo id                                                             repo の名前
appstream                                                           CentOS Linux 8 - AppStream
baseos                                                              CentOS Linux 8 - BaseOS
epel                                                                Extra Packages for Enterprise Linux 8 - x86_64
epel-modular                                                        Extra Packages for Enterprise Linux Modular 8 - x86_64
extras                                                              CentOS Linux 8 - Extras
gitlab_gitlab-ee                                                    gitlab_gitlab-ee
gitlab_gitlab-ee-source                                             gitlab_gitlab-ee-source
powertools                                                          CentOS Linux 8 - PowerTools

安装GitLab软件包。将指定的URL http://centos8-dev/gitlab设置为GitLab的启动配置。

[doshi@centos8 ~]$ sudo EXTERNAL_URL="http://centos8-dev/gitlab" dnf install -y gitlab-ee

成功安装后,将显示以下内容。


       *.                  *.
      ***                 ***
     *****               *****
    .******             *******
    ********            ********
   ,,,,,,,,,***********,,,,,,,,,
  ,,,,,,,,,,,*********,,,,,,,,,,,
  .,,,,,,,,,,,*******,,,,,,,,,,,,
      ,,,,,,,,,*****,,,,,,,,,.
         ,,,,,,,****,,,,,,
            .,,,***,,,,
                ,*,.



     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/


Thank you for installing GitLab!

3. 更改Nginx的端口号。

由于Apache正在80号端口上运行,因此需要将nginx在8081号端口上启动。

打开/etc/gitlab/gitlab.rb文件。

[doshi@centos8 ~]$ sudo vi /etc/gitlab/gitlab.rb

将listen_port设置为8081。

nginx['listen_port'] = 8081

执行GitLab的重新配置。

[doshi@centos8 ~]$ sudo gitlab-ctl reconfigure

4. Apache反向代理设置

将对Apache的80号端口上的访问http://centos8-dev/gitlab/进行代理,代理到Nginx的8081号端口上的访问http://localhost:8081/gitlab/。

打开 /etc/httpd/conf.d/gitlab.conf 文件。

[doshi@centos8 ~]$ sudo vi /etc/httpd/conf.d/gitlab.conf

设定如下。

<Location /gitlab>
 ProxyPass http://localhost:8081/gitlab
 ProxyPassReverse http://localhost:8081/gitlab
</Location>
<Location /assets>
 ProxyPass http://localhost:8081/assets
 ProxyPassReverse http://localhost:8081/assets
</Location>

重启Apache。

[doshi@centos8 ~]$ sudo systemctl restart httpd.service

利用或使用。

在Redmine中进行日志轮转

根据logrotate的设定,默认情况下进行了日志轮转。

Omnibus GitLab的备份与恢复

参考 Omnibus GitLab 的备份和恢复配置。

升级

参考GitLab Omnibus包安装更新。

目录

以下是数据积累的目录。

ディレクトリ 用途 /var/opt/gitlab/ GitLabのデータが配置されるディレクトリ

最后

如果有任何指导或建议,请毫不犹豫地提出来。

引用文献

这篇文章的参考资料如下。

    GitLab公式サイト
bannerAds