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 install GitLab under Linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article is about how to install GitLab under Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

GitLab is a self-hosted Git project repository developed by Ruby, which can access public or private projects through the Web interface.

1. Install VMware and CentOS this tutorial uses CentOS6.6

Configure static IP reference: https://www.cnblogs.com/linyufeng/p/8515337.html

two。 Install the prerequisite Linux plug-in (if you have installed it, you don't have to)

Yum install-y vim wget3. Prepare to install GitLab yum install-y postfix sshd policycoreutils-pythonpostfix email notifications

Sshd ssh service (general system already has it, so it can not be installed)

Policycoreutils-python GitLab must depend on

Set postfix to boot: chkconfig-- add postfix

4. Start installing GitLab2 official website download address: https://packages.gitlab.com/app/gitlab/gitlab-ce/search?q=10.0.2

Take CentOS 6 as an example: https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/6/gitlab-ce-10.0.2-ce.0.el6.x86_64.rpm

There are two installation methods: using yum and rpm packages. This article introduces the yum method.

Curl-s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash yum install-y gitlab-ce-10.0.2-ce.0.el6.x86_645. To configure GitLab, there are two main configurations: the IP address of accessing GitLab and the account configuration for sending mail.

Vim / etc/gitlab/gitlab.rb copyexternal_url 'http://192.168.183.200' # your own IP # Email Settings gitlab_rails [' gitlab_email_enabled'] = true gitlab_rails ['gitlab_email_from'] =' your mailbox 'gitlab_rails [' gitlab_email_display_name'] = 'email name' # GitLab email server settings # # here the mail server uses QQ enterprise mailbox Modify gitlab_rails ['smtp_enable'] = true gitlab_rails [' smtp_address'] = "smtp.exmail.qq.com" gitlab_rails ['smtp_port'] = 465 gitlab_rails [' smtp_user_name'] = "your mailbox" gitlab_rails ['smtp_password'] = "mailbox password" gitlab_rails [' smtp_authentication'] = "login" gitlab_rails ['smtp_enable_starttls_auto'] = true gitlab_rails [' Smtp_tls'] = trueESC save and exit: wq

6. Start GitLab refresh configuration: gitlab-ctl reconfigure restart service: gitlab-ctl restart

7. The GitLab cannot be accessed at this time. You need to turn off the firewall service iptables stop or open port 80 in the firewall:

Edit iptables vi / etc/sysconfig/iptables

Add configuration-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 80-j ACCEPT

Restart Firewall service iptables restart

Visit http://192.168.183.200/

You need to change the root password for the first login. The password is more than 8 digits, and you can log in after you change it.

GitLab initial interface

8. There are 2 ways to add users in GitLab basic operation: root backend add and self-registration.

Mode 1

Mode 2

User permissions

Regular: you can access your own groups and projects

Admin: access to all groups and projects

Add Group

Group permissions

Private: for private use, only group members are allowed to see

Internal: internal, visible to all logged in users

Public: public, visible to everyone

Creating repositories and adding members to the group is simple and won't go into detail. Focus on the permissions of warehouse members.

Guest: you can create issue, post comments, and cannot read or write version libraries

Reporter: code can be cloned and cannot be submitted. QA and PM can give this permission.

Developer: you can clone code, develop, submit, and push,RD can grant this permission

Master: you can create projects, add tag, protect branches, add project members, edit projects, and core RD leaders can grant this permission

Owner: you can set project access rights-Visibility Level, delete projects, migrate projects, manage team members, which can be granted by the development group leader

The default Developer role cannot be push to master, and the master branch is protected; it can be modified as follows:

Test sending email

Copygitlab-rails console irb (main): 003Message Subject', 0 > Notify.test_email ('mailbox', 'Message Subject',' Message Body'). Thank you for reading! This is the end of this article on "how to install GitLab under Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

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