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 a local GitLab server on CentOS7

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article introduces the relevant knowledge of "how to build a local GitLab server on CentOS7". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Install and configure the necessary dependencies

The first step is to install the required dependencies on the CentOS system: ssh, firewall, postfix (for mail notifications), wegt, and the following commands also open HTTP and SSH port access in the system firewall.

1. Install SSH protocol

Installation command: sudo yum install-y curl policycoreutils-python openssh-server

The interface shown in the following figure indicates that the installation is successful:

2. Set the SSH service to start automatically.

Installation command: sudo systemctl enable sshd

3. Start the SSH service

Start command: sudo systemctl start sshd

4. Install the firewall

Installation command: yum install firewalld systemd-y

The interface shown in the following figure indicates that the installation is successful:

5. Turn on the firewall

Open command: service firewalld start

6. Add HTTP service to firewalld

Installation command: sudo firewall-cmd-- permanent-- add-service=http

Among them, pemmanent means permanent effect, if not added-- the permanent system will become invalid after the next startup.

7. Restart the firewall

Restart command: sudo systemctl reload firewalld

8. Install Postfix to send mail

Installation command: sudo yum install postfix

9. Set the postfix service to boot automatically

Command: sudo systemctl enable postfix

10. Start postfix

Start command: sudo systemctl start postfix

11. Install wget for downloading plug-ins from the extranet

Installation command: sudo yum-y install wget

The following interface indicates that the installation is successful:

12. Install the vim editor

Installation command: sudo yum install vim-y

The following interface indicates that the installation is successful:

Add GitLab image source and install gitlab server 1, add gitlab image

Command: wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.5.7-ce.0.el7.x86_64.rpm

The interface shown in the following figure indicates that the download is complete, and then you can install Gitlab:

2. Install Gitlab

Command: rpm-I gitlab-ce-10.5.7-ce.0.el7.x86_64.rpm

The installation process will take some time, and if the interface shown in the following figure appears, the Gitlab installation is successful:

3. Modify the gitlab configuration file to specify the server ip and custom port:

Command: vim / etc/gitlab/gitlab.rb

Then enter the editor, which is to enter the lowercase "I" into edit mode:

Press ESC to exit edit mode, and then enter the command ": wq" to save and exit.

4. Add port 9090 to the firewall

Command: firewall-cmd--zone=public--add-port=9090/tcp--permanent

5. Restart the firewall

Restart command: sudo systemctl reload firewalld

6. Reset gitlab

Command: gitlab-ctl reconfigure

The reset process will take some time:

The following interface indicates that the reset is successful:

7. Start gitlab

Command: gitlab-ctl restart

The following interface indicates that the startup is successful:

8. Visit the Gitlab page

If the domain name is not set, you can directly enter the server IP and the specified port number in the browser to access it. When you log in for the first time, you will enter the password modification interface by default:

This is the end of the content of "how to build a local GitLab server on CentOS7". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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

Development

Wechat

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

12
Report