Home  >  Article  >  Development Tools  >  Detailed steps to build Gitlab on centos (share)

Detailed steps to build Gitlab on centos (share)

PHPz
PHPzOriginal
2023-04-03 11:53:241016browse

With the continuous development of software development, code version control has become an essential tool for any software development team. As a free, open source, easy to install and manage code management platform, Gitlab has been widely used in various development teams. This article will introduce the detailed steps to build Gitlab on CentOS system.

Preparation work

Before starting to install Gitlab, we need to prepare the following work:

  • Install the CentOS system and enable SSH remote login permission;
  • Ensure that the complete curl and openssh-server services have been installed in the system;
  • Install and configure Ruby and Git in the system.

Install Gitlab

  1. Add Gitlab source

First we need to add the yum source of Gitlab in order to use the yum command to install Gitlab.

$ sudo curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

  1. Install Gitlab

After the addition is successful, we can use yum to install Gitlab.

$ sudo yum install gitlab-ce

  1. Configure Gitlab

After installing Gitlab, we need to execute the following command to configure the access address and port of Gitlab :

$ sudo vi /etc/gitlab/gitlab.rb

In the opened file, find the following two lines:

external_url 'http://gitlab.example .com'

gitlab_workhorse['listen_network'] = 'tcp'

Change the address of external_url to the public IP address, as follows:

external_url 'http:// 192.168.1.100'

Configure listen_network to unix, and modify listen_addr to unix:/var/opt/gitlab/gitlab-workhorse/socket.

gitlab_workhorse['listen_network'] = 'unix'
gitlab_workhorse['listen_addr'] = "unix:/var/opt/gitlab/gitlab-workhorse/socket"

  1. Start Gitlab

After completing the configuration, we need to restart Gitlab for the configuration to take effect.

$ sudo gitlab-ctl reconfigure

  1. Access Gitlab

Now we can use the browser to access Gitlab, the address is http://{{ ip_address}}. After successful access, you can start using Gitlab for code version management.

Summary

This article briefly introduces the detailed steps on how to build Gitlab on CentOS system. It should be noted that when actually using Gitlab, we need to further configure Gitlab's user permissions, HTTPS certificate, etc. to meet the specific needs of the team. I hope this article can be helpful to everyone.

The above is the detailed content of Detailed steps to build Gitlab on centos (share). For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn