Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build your own gitlab

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how to build your own gitlab". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to build your own gitlab".

Build your own gitLab

There are already mature git repositories on the market, such as github, where Code Cloud can manage its own code. Here I will show you how to build your own gitlab server.

First of all, you need to have your own server. My server is centos. I'll take cenos7.6 as an example.

Secondly, it is introduced that 4G of memory does not matter, but gitlab is more likely to eat memory, if there is only 1G of memory, it is recommended to build Gogs, lightweight. Mine is 2 gigabytes of memory, and it still runs on ok, but sometimes it gets stuck.

Start 1. Install related dependencies first

Yum-y install policycoreutils openssh-server openssh-clients postfix

two。 Start postfix and set it to boot (purpose: to support gitlab mail sending)

Systemctl enable postfix & & systemctl start postfix

3. Download and install the RPM package for Gitlab Community Edition

Pay attention to download the version suitable for your system. My machine is cenos7.6 64-bit.

Sudo yum install gitlab-ce-10.5.2-ce.0.el7.x86_64

Ps: download link: https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-10.5.2-ce.0.el7.x86_64.rpm

EL is the abbreviation of Red Hat Enterprise Linux.

EL6 package is used for installation in Red Hat 6.x, CentOS 6.x, and CloudLinux 6.x

EL5 package is used for installation in Red Hat 5.x, CentOS 5.x, CloudLinux 5.x

EL7 package is used for installation of Red Hat 7.x, CentOS 7.x, and CloudLinux 7.x

4. Modify gitlab configuration

Modify gitlab.rb

/ etc/gitlab/gitlab.rb

Change external_url to the domain name or IP address of the deployment machine

Modify gitlab.yaml

/ var/opt/gitlab/gitlab-rails/etc/gitlab.yml

Find the keyword * # # Web server settings *

Change the value of host to the ip address of the local machine

5. Reset and restart gitlab

Reset

Gitlab-ctl reconfigure

The first reset is slow and may take a few minutes

Restart gitlab-ctl restart

6. Domain name access

If you can access the domain name directly, you can transfer it to the gitlab page.

You may need to reset the password of root for the first time. You can enter it after filling in the password.

After entering, in the place set by the user, you can fill in the SSH key of your computer, and then you can freely check the code.

7. About the problem of startup port occupancy

Since gitlab starts on port 8080 by default, if port 8080 is already occupied, you can start gitlab on another port.

The method of modifying the port can be self-google, so I will not introduce it here. Because port 80 on my machine is not occupied yet. :)

Thank you for reading, the above is the content of "how to build your own gitlab". After the study of this article, I believe you have a deeper understanding of how to build your own gitlab, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report