CentOS 7 build GitLab code repository server

Ready to work

If it is set up to a remote server, you also need to connect remotely to Linux, I used here is PuTTY

Installation and Configuration software

Install curl, policycoreutils-python, openssh-server software and configure the firewall permission to open SSH, HTTP, HTTPS of

sudo yum install -y curl policycoreutils-python openssh-server
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld

Then install Postfix, for GitLab send some e-mail notification, such as registering new users or modify the notification e-mail user's password, you can skip this step, and so on after the installation is complete GitLab configure other mail server

sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix

installation

GitLab first configure the installation package repository address, will be installed will download the installation package from this address

Supplement here under, GitLab there are two versions, one version of the open source community, a corporate version. Here is the configuration download Enterprise Edition, Enterprise Edition includes all the features of the community to do, but also includes some advanced premium features, sold separately activation code. The benefits of installing Enterprise Edition is if one day want to upgrade to a paid upgrade activation code it can be purchased directly without having to reinstall

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

Start the installation, where the value is set EXTERNAL_URL address GitLab build up visit will https://gitlab.example.com replaced with your own domain name can be configured

sudo EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ee

If there is no domain name can be set directly address of the server port number plus open, I assume that the server address is 1.2.3.4, the port number is 8090

sudo EXTERNAL_URL="http://1.2.3.4:8090" yum install -y gitlab-ee

 Or not provided EXTERNAL_URL, configurations, etc. into the configuration file after installation by vim /etc/gitlab/gitlab.rb

sudo yum install -y gitlab-ee

About configuration EXTERNAL_URL, please refer to this article Configuring the external URL for GitLab

external_url "http://1.2.3.4:8090"

Open firewall ports

GitLab default port 8080, we configured above 8090, do not forget to open the firewall port configuration, port configuration is also not being used by another program

firewall-cmd --permanent --add-port=8090/tcp  //新增端口开放,如果不设置--permanent则系统重启后失效
firewall-cmd --reload   //新增端口开放后都要运行

Encountered pit

Successful operation before GitLab also fill some of the pits, the article concluded that other, as shown below

Start and stop services

After installing the above steps can be direct browser access to open GitLab, the service will automatically run when the server is started under normal circumstances

We can also start and stop the service manually by

# Start all GitLab components
sudo gitlab-ctl start

# Stop all GitLab components
sudo gitlab-ctl stop

# Restart all GitLab components
sudo gitlab-ctl restart

access

Enter the address in the browser to access the configuration you direct access, for example, I configured http://1.2.3.4:8090

The first visit will jump to the following page to configure the administrator account password for root, you configure the root account can log in through

After logging in, we can create an account, create a project, GitLab there are many features waiting for you to explore, but is beyond the scope of this article

 

reference

Published 287 original articles · won praise 44 · Views 150,000 +

Guess you like

Origin blog.csdn.net/mqdxiaoxiao/article/details/104497764