Install Gitlab on Ubuntu 16.04

2. 1. Preparation

sudo apt-get update
sudo apt-get install -y curl openssh-server ca-certificates
sudo apt-get install -y postfix
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

Change address

vi /etc/apt/sources.list.d/gitlab_gitlab-ce.list

content changed to

deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu xenial main

2. Install the ce version, which is the community version, and the enterprise version is gitlab-ee 

sudo apt-get update 
sudo apt-get install gitlab-ce

3. Follow-up

Modify the configuration file /etc/gitlab/gitlab.rb as needed

The most important thing is external_url, which does not affect the actual access address, but will affect the library address that can be copied through the button on the home page of the git library.

To enable email, take Tencent Enterprise Email as an example, the corresponding configuration of /etc/gitlab/gitlab.rb is as follows

### Email Settings
gitlab_rails['gitlab_email_enabled'] = true
gitlab_rails['gitlab_email_from'] = '[email protected]'
gitlab_rails['gitlab_email_display_name'] = 'XXXX'
gitlab_rails['gitlab_email_reply_to'] = '[email protected]'
gitlab_rails['gitlab_email_subject_suffix'] = ''

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.exmail.qq.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "[email protected]"
gitlab_rails['smtp_password'] = "password"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['gitlab_email_from'] = '[email protected]'


4. Enable configuration and start:

sudo gitlab-ctl reconfigure
sudo gitlab-ctl start

Browser access: default is port 80

Check if email is available

gitlab-rails console
 irb(main):003:0> Notify.test_email('[email protected]', 'Message Subject', 'Message Body').deliver_now

5. Other references

http://blog.csdn.net/ouyang_peng/article/details/72903221

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325482880&siteId=291194637