search
HomeOperation and MaintenanceCentOSHow to set up Gitlab server in CentOS7

The following tutorial column of centos system introduction will introduce to you how to build a Gitlab server in CentOS7. I hope it will be helpful to friends in need!

How to set up Gitlab server in CentOS7

CentOS7 to build Gitlab server

CentOSInstall the necessary Dependencies

Step 1: Install ssh

yum install -y curl policycoreutils-pythonopenssh-server

How to set up Gitlab server in CentOS7

How to set up Gitlab server in CentOS7

##Step 2: Set the SSH service to Automatically start the SSH service at boot (if installed and started, you can skip this step);

sudo systemctl enable sshd
sudo systemctl start sshd

Step 3: Install and start the firewall (if installed and started, you can skip this step);

yum install firewalld systemd -y
service firewalld start

Step 4: Add the http service to firewalld (--permanent means permanent);

firewall-cmd --permanent --add-service=http

How to set up Gitlab server in CentOS7

Step 5: Restart the firewall;

systemctl reload firewalld

Step 6: Set the postfix service to start automatically at boot and start postfix;

systemctl enable postfix
systemctl start postfix

Step 7: Check whether wget has been installed in the system (if not, use yum to install wget);

wget -V --检查wget版本
yum -y install wget --yum安装wget

CentOS installation necessary dependencies

The first step: wget download gitlab (community version);

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

How to set up Gitlab server in CentOS7

The second step: Install gitlab;

rpm -i gitlab-ce-11.2.1-ce.0.el7.x86_64.rpm

If the following error occurs, you need to install policycoreutils-python;

How to set up Gitlab server in CentOS7

yum -y install policycoreutils-python

How to set up Gitlab server in CentOS7

How to set up Gitlab server in CentOS7

Step 3: Modify the gitlab configuration file, specify the server IP and custom port;

vi /etc/gitlab/gitlab.rb

Modify the URL: external_url 'http://192.168.2.121:8081'

How to set up Gitlab server in CentOS7

Modify port: nginx['listen_port'] = 8081

How to set up Gitlab server in CentOS7

To modify the configuration of unicorn

How to set up Gitlab server in CentOS7

Step 4: Reset and start GitLab;

Reset configuration: gitlab-ctl reconfigure

How to set up Gitlab server in CentOS7

Restart gitlab service: gitlab- ctl restart

How to set up Gitlab server in CentOS7

Step 5: Access Gitlab, log in for the first time, and change the password;

Initial user: root

Initial password: 5iveL !fe

How to set up Gitlab server in CentOS7

If it cannot be accessed, you can check whether the port is disabled;

Check the port status: netstat -lntp; if the netstat command does not exist, install yum install net-tools -y, because CentOS7 does not include net-tools, so the ifconfig command is not available. After installing net-tools, you can use the netstat and ifconfig commands;

Firewall open port:

firewall-cmd --zone=public --add-port=8081/tcp --permanent

Reload firewall list:

firewall-cmd --reload

The above is the detailed content of How to set up Gitlab server in CentOS7. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:jianshu. If there is any infringement, please contact admin@php.cn delete
The Reasons for CentOS's Shutdown: A Detailed AnalysisThe Reasons for CentOS's Shutdown: A Detailed AnalysisMay 03, 2025 am 12:05 AM

RedHat shut down CentOS8.x and launches CentOSStream because it hopes to provide a platform closer to the RHEL development cycle through the latter. 1. CentOSStream, as the upstream development platform of RHEL, adopts a rolling release mode. 2. This transformation aims to enable the community to get exposure to new RHEL features earlier and provide feedback to accelerate the RHEL development cycle. 3. Users need to adapt to changing systems and reevaluate system requirements and migration strategies.

CentOS: The Advantages of Using This Linux DistroCentOS: The Advantages of Using This Linux DistroMay 02, 2025 am 12:10 AM

CentOS stands out among enterprise Linux distributions because of its stability, security, community support and enterprise application advantages. 1. Stability: The update cycle is long and the software package has been strictly tested. 2. Security: Inherit the security features of RHEL, update and announce in a timely manner. 3. Community support: a huge community and detailed documentation to respond to problems quickly. 4. Enterprise applications: Support container technologies such as Docker, suitable for modern application deployment.

Comparing CentOS Replacements: Features and BenefitsComparing CentOS Replacements: Features and BenefitsMay 01, 2025 am 12:05 AM

Alternatives to CentOS include AlmaLinux, RockyLinux, and OracleLinux. 1.AlmaLinux provides RHEL compatibility and community-driven development. 2. RockyLinux emphasizes enterprise-level support and long-term maintenance. 3. OracleLinux provides Oracle-specific optimization and support. These alternatives have similar stability and compatibility to CentOS, and are suitable for users with different needs.

CentOS vs. Other Linux Distributions: A ComparisonCentOS vs. Other Linux Distributions: A ComparisonApr 30, 2025 am 12:07 AM

CentOS is suitable for enterprise and server environments due to its stability and long life cycle. 1.CentOS provides up to 10 years of support, suitable for scenarios that require stable operation. 2.Ubuntu is suitable for environments that require quick updates and user-friendly. 3.Debian is suitable for developers who need pure and free software. 4.Fedora is suitable for users who like to try the latest technologies.

CentOS's Departure: Choosing the Right AlternativeCentOS's Departure: Choosing the Right AlternativeApr 29, 2025 am 12:04 AM

Alternatives to CentOS include AlmaLinux, RockyLinux, and OracleLinux. 1.AlmaLinux and RockyLinux rebuild RHEL 1:1, providing high stability and compatibility, suitable for enterprise environments. 2. OracleLinux provides high performance through UEK, suitable for users who are familiar with the Oracle technology stack. 3. When choosing, stability, community support and package management should be considered.

CentOS's Replacement: Exploring the New OptionsCentOS's Replacement: Exploring the New OptionsApr 28, 2025 am 12:17 AM

CentOS alternatives include RockyLinux, AlmaLinux, and OracleLinux. 1. RockyLinux and AlmaLinux provide stable distributions compatible with RHEL, suitable for users who need long-term support. 2. CentOSStream is suitable for users who focus on new features and development cycles. 3. OracleLinux is suitable for users who need enterprise-level support.

Replacing CentOS: Identifying Suitable ReplacementsReplacing CentOS: Identifying Suitable ReplacementsApr 27, 2025 am 12:04 AM

CentOS needs alternatives because CentOSStream no longer provides long-term support. Alternative options include: 1. RockyLinux, which provides 10 years of life cycle support, suitable for users who need stability. 2.AlmaLinux also provides 10 years of support and has strong community support. 3. OracleLinux, provides RHEL-compatible version, and flexible life cycle management.

The End of CentOS: Evaluating the ImpactThe End of CentOS: Evaluating the ImpactApr 26, 2025 am 12:03 AM

The end of CentOS has had a significant impact on users, with users having the option of RHEL, AlmaLinux, Debian or Ubuntu as alternatives. 1. The migration cost is high, requiring time and money. 2. Community division affects open source projects. 3.RHEL provides commercial support, but it is costly. 4.AlmaLinux is similar to CentOS and has low migration costs. 5. Debian and Ubuntu need more time to adapt.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment