CENTOS7 install GITLAB, localization, mailbox configuration and use

Source: Internet
Author: User
Tags ssh access

CENTOS7 install GITLAB, localization, mailbox configuration and use

1. GitLab Introduction

GitLab is an open-source version management system developed using Ruby On Rails. It implements a self-managed Git project repository, which is a collection of code hosting and testing, it is deployed in one open-source git repository management software and can access public or private projects through the web interface. Similar to Github, GitLab can browse code and manage defects and comments. Allows the management team to access the repository. It is easy to browse submitted versions and provides a file history library. It also provides a code fragment collection function that allows you to easily reuse code, so that you can search for it as needed in the future.

Git family members:

  • Git: a version control system, a command, and a tool.
  • Gitlib: A Development library used to implement Git functions.
  • Github: it is an online code hosting repository based on Git. public projects are free of charge, and private projects can be created at a paid price.
  • GitLab: an online code repository hosting software based on Git. You can use GitLab to build a Github-like system.

GitLab still has certain requirements on hardware. A Core CPU can basically meet the requirements and support about 100 users, however, when running the GitLab website, you need to run multiple backend jobs, which may be a little stretched. At least 4 GB of addressable memory (RAM swap) is required to install and use GitLab. The operating system and any other running applications will also use the memory, so remember that before running GitLab, you need at least 4 GB of available space. If less memory is used, GitLab will give a strange error during the re-configuration operation. I use virtual machines to create a CentOS system with 1 GB and 2 GB memory respectively to install GitLab, it is really too hard to hurt.

2. GitLab Installation

1. On the CentOS system, the following command opens the system firewall for HTTP and SSH access.

sudo yum install curl policycoreutils openssh-server openssh-clientssudo systemctl enable sshdsudo systemctl start sshdsudo yum install postfixsudo systemctl enable postfixsudo systemctl start postfixsudo firewall-cmd --permanent --add-service=httpsudo systemctl reload firewalld

2. Add and install the GitLab Image Source

curl -sS http://packages.gitlab.com.cn/install/gitlab-ce/script.rpm.sh | sudo bash

This is the official yum source, and the installation speed is slow. You can use the domestic source and modify the following file:

vim /etc/yum.repos.d/gitlab_gitlab-ce.repo

The modification content is as follows:

[gitlab-ce]name=gitlab-cebaseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7repo_gpgcheck=0gpgcheck=0enabled=1gpgkey=https://packages.gitlab.com/gpg.key

Then execute:

Sudo yum install gitlab-ce # configure and start GitLabsudo gitlab-ctl reconfigure

If the installation is successful, the following message is displayed:

3. When you access GitLab for the first time, the system will redirect the page to the Reset Password page. You need to enter the password for initializing the administrator account. The administrator username is root and the initial password is 5 iveL! Fe. After the password is reset, the new password is the password you just entered.

Iii. Localization of GitLab

After successfully installing GitLab, many of my friends will think of localization. Of course, if the team's English skills are good, there is no need for localization.

GitLab projects in the Chinese community, v7-v8.8 is the "GitLab Chinese community edition project" (https://gitlab.com/larryli/gitlab) launched by Larry Li, starting from v8.9 and continuing the Chinese project (https://gitlab.com/xhang/gitlab) by @ xhang ).

mkdir /home/local/gitlabcd /home/local/gitlab

If git is not installed, install it in advance:

yum install -y git

Download the latest Chinese package:

git clone https://gitlab.com/xhang/gitlab.git

To download the traditional version of the Chinese package, add the branch of the old version. To download 10.0.2, run the following statement:

git clone https://gitlab.com/xhang/gitlab.git -b v10.0.2-zh

Stop GitLab and execute the following statement:

gitlab-ctl stopcp /home/local/gitlab/* /opt/gitlab/embedded/service/gitlab-rails/ -rf

During replication, the system may constantly prompt whether to overwrite the data. This may be the alias for executing the cp-I command every time the system executes the cp command. In this case, you can modify it ~ /. Bashrc, add # comment before "alias cp = 'cp-I.

The following message may appear during replication, so ignore it.

Note the following:

source ~/.bashrc

Or restart.

Next, you can reconfigure and start it:

sudo gitlab-ctl reconfiguresudo gitlab-ctl restart

The interface after successful Chinese conversion is as follows:

4. GitLab commands

Syntax:

Gitlab-ctl command (subcommand)

Service Management Commands

Start

Start all services

Stop

Close all services

Restart

Restart all services

Status

View All service statuses

Tail

View log information

Service-list

List all startup services

Graceful-kill

Stop a service smoothly

Example:

# Start all services

[Root @ gitlab ~] # Gitlab-ctl start

# Start a separate service

[Root @ gitlab ~] # Gitlab-ctl start nginx

# View logs and view all logs

[Root @ gitlab ~] # Gitlab-ctl tail

# View a specific log, similar to tail-f

[Root @ gitlab ~] # Gitlab-ctl tail nginx

General Commands

Help

Help

Reconfigure

After modifying the configuration file, you need to reload it

Show-config

View All service configuration files

Uninstall

Uninstall this software

Cleanse

Delete gitlab data and start from scratch

Example:

# Display all service configuration files

[Root @ gitlab ~] # Gitlab-ctl show-config

# Uninstall gitlab

[Root @ gitlab ~] # Gitlab-ctl uninstall


V. QQ mailbox Configuration

By default, GitLab cannot send confirmation emails when registering with QQ mail. I checked many mailbox configuration tutorials on the Internet, most of which are incorrect. Some tutorials say that it is misleading to modify/opt/gitlab/etc/gitlab. rb. Such software is summarized as one sentence:The document on the official website prevails.

Qq mail is best to use enterprise mail, I use personal mail for testing is a little problem.

The correct configuration is as follows:

# vim /etc/gitlab/gitlab.rbgitlab_rails['smtp_enable'] = truegitlab_rails['smtp_address'] = "smtp.exmail.qq.com"gitlab_rails['smtp_port'] = 465gitlab_rails['smtp_user_name'] = "xxxx@xx.com"gitlab_rails['smtp_password'] = "password"gitlab_rails['smtp_authentication'] = "login"gitlab_rails['smtp_enable_starttls_auto'] = truegitlab_rails['smtp_tls'] = truegitlab_rails['gitlab_email_from'] = 'xxxx@xx.com'

If you have any problems during the installation and use process, you can leave a message and I will try my best to reply as soon as possible. I hope this will help you a little.

Reference: https://www.gitlab.cc/installation/#centos-7

Https://docs.gitlab.com/omnibus/settings/smtp.html

Https://yq.aliyun.com/articles/74395

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.