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

Installation and erection of Gitlab

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

I. brief introduction

Git

Git is an open source version control system that can manage project versions efficiently. It is also a version control software.

GitHub

GitHub is a hosting platform for open source and proprietary software projects. GitHub can host various Git libraries and provide a web interface.

GitLab

GitLab is an open source project for warehouse management system. Using git for code management tools, you can build your own GitLab warehouse server.

GitLab: is an online code warehouse hosting software based on Git. You can use gitlab to build a system similar to Github, which is generally used to build git private servers in enterprises, schools and other internal networks.

Function: Gitlab is a code management platform that provides code hosting, submission review, and problem tracking. It is very important for software engineering quality management.

Version: GitLab is divided into community version (CE) and enterprise version (EE).

Configuration: recommended CPU2 core, memory above 2G.

Advantages:

1.git is distributed, svn is not

Git distributed local can be used, you can save a variety of history traces, do not have to worry about polluting the server, not even the server can submit code, view log.

The 2.GIT branch is different from the SVN branch.

A branch is actually a copy in a version repository in SVN, while a repository in git is a snapshot, so git switching, merging branches, and so on are faster.

3.git has a powerful code warehouse management system-gitlab

You can easily manage permissions, code review, create and manage project

Warehouse data location: ls / var/opt/gitlab/git-data/repositories/

2. Parameters and operation

1. Download the official YumSource, yum install gitlab Image Source of Tsinghua University:

Https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce

Install dependencies

Yum install-y curl openssh-server openssh-clients postfix cronie policycoreutils-python

Start postfix and set it to boot

Systemctl start postfix

Systemctl enable postfix

Set up a firewall (negligible)

Firewall-cmd-add-service=http-permanent

Firewall-cmd-reload

Gitlab-ctl reconfigure overload

Gitlab-ctl restart restart

View version cat / opt/gitlab/embedded/service/gitlab-rails/VERSION 11.3.6

two。 Change the default port

Using gitlab's built-in nginx, modify the nginx default port from 80 to 82.

Because of the above configuration at this time, modifying the following files will change the default values. At the same time, if you rerun gitlab-ctl reconfigure, the changes will not be overwritten.

Change the default listening 8080 to 8082

Gitlab_workhorse ['auth_backend'] = "http://localhost:8082"

Unicorn ['port'] = 808 original value unicorn [' port'] = 8080

Vi / var/opt/gitlab/nginx/conf/gitlab-http.conf should be the same as the above.

Listen: 82; # default value listen: 80

4. Using the gitlab built-in nginx, change the default port of the modified unicorn from 8080 to 8082. That is, the rails port that nginx listens to, similar to php-fpm

Vi / var/opt/gitlab/gitlab-rails/etc/unicorn.rb

Listen "127.0.0.1 true 8082",: tcp_nopush = >

# original value listen "127.0.0.1 true 8080",: tcp_nopush = >

Gitlab-ctl restart

Access after 30 seconds otherwise 502 or 404

5. Sinicization:

1. View gitlab version cat / opt/gitlab/embedded/service/gitlab-rails/VERSION

two。 Download the corresponding Chinese package https://gitlab.com/xhang/gitlab

3. Decompress and enter the Chinese package catalog to view the version cat gitlab-11-1-stable-zh/VERSION

4. Backup first to prevent Sinicization failure and repair cp-r / opt/gitlab/embedded/service/gitlab-rails/ / home/test/bak in time

5. Check the alias alias and note alias cp=cp-I

6.vim ~ / .bashrc write off cp-I (change it back when you're done)

7.\ cp-rf gitlab-11-2-stable-zh/ / opt/gitlab/embedded/service/gitlab-rails/

7. Reload and restart gitlab-ctl reconfigure gitlab-ctl restart

6. Backup settin

# backup every day, delete the backup before 7 days after 7 days

# gitlab_rails ['manage_backup_path'] = true

Gitlab_rails ['backup_path'] = "/ var/opt/gitlab/backups"

# delete the previous one after 7 days in 604800 seconds

Gitlab_rails ['backup_keep_time'] = 604800

7. Command interpretation

502 error 404

1. Train of thought

Generally, if you have just restarted the service, wait for 1 minute. Be sure to check the nginx log and gitlab status (gitlab-ctl status), and check the port occupancy of the / etc/gitlab configuration file.

two。 Solve

Gitlab-ctl restart sidekiq

Gitlab-ctl hup unicorn

Prompt warning for 3.clone: templates not found / usr/share/git-core/templates

Just create this directory.

4.git clone shh... Prompt for git password when

Check whether the public key file and authorized_keys are consistent with the public key

Then try to add ssh-add ~ / .ssh/45id_rsa

5.ssh_exchange_identification: read: Connection reset by peer

Fatal: Could not read from remote repository.

Note that the file / etc/hosts.deny is not your own IP rejected in it!

"if you are on a Git clone, you will be prompted for a password, such as git@gitlab.com's password:"

There is a problem with the SSH setting. Mie

Ensure that you have correctly generated the SSH key pair and added the public SSH key to the GitLab configuration file

Try to register your private SSH key manually using the method described earlier in ssh-agent this document

Try to debug a connection to ssh-Tv git@example.com by running

(replace example.com with your Gitlab domain)

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

Servers

Wechat

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

12
Report