Alicloud CentOs7 installation Gitlab is available for pro test

Keywords: Programming GitLab sudo firewall yum

Install GitLab

Installation steps of official website:

https://about.gitlab.com/install/#centos-7

  1. Configuration before installation, firewall and so on
  2. Mail configuration
  3. Landing gitlab

Install Gitlab

  • Open http and ssh access of firewall
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 systemctl reload firewalld

  • Install Postfix mail notification
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix

If you want something else, Reference link

[root@iZm5e1zao4uxbr8etk59y5Z /]# sudo systemctl start postfix

Job for postfix.service failed because the control process exited with error code. See "systemctl status postfix.service" and "journalctl -xe" for details.

In case of error, solution:

modify /etc/postfix/main.cf Set up  
  
inet_protocols = ipv4  
inet_interfaces = all 

vim operation http://www.cnblogs.com/z-x-y/p/9198481.html

  • Execute the installation of gitlab. The external "URL is the IP address of the server, and can also be set as the domain name. Port defaults to 80
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash

sudo EXTERNAL_URL="http:115.29.67.31" yum install -y gitlab-ee

The following figure shows that the installation is successful.

       *.                  *.
      ***                 ***
     *****               *****
    .******             *******
    ********            ********
   ,,,,,,,,,***********,,,,,,,,,
  ,,,,,,,,,,,*********,,,,,,,,,,,
  .,,,,,,,,,,,*******,,,,,,,,,,,,
      ,,,,,,,,,*****,,,,,,,,,.
         ,,,,,,,****,,,,,,
            .,,,***,,,,
                ,*,.
  


     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/
  

Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
  sudo gitlab-ctl reconfigure

For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

  Verifying  : gitlab-ee-11.10.4-ee.0.el7.x86_64                                                                                                                                                             1/1 

Installed:
  gitlab-ee.x86_64 0:11.10.4-ee.0.el7                                                                                                                                                                            

Complete!
You have mail in /var/spool/mail/root

/etc/gitlab/gitlab.rb modify the external_url,

external_url 'http://XX.XX.XX.XX'

Then, refresh the configuration sudo gitlab CTL reconfigure

Configure mail

Configure sender

### Email Settings
 gitlab_rails['gitlab_email_enabled'] = true
 gitlab_rails['gitlab_email_from'] = 'chenglitao@wangxiaobao.com'
 gitlab_rails['gitlab_email_display_name'] = 'Gitlab'

configure server

 gitlab_rails['smtp_enable'] = true
 gitlab_rails['smtp_address'] = "smtp.XXX.com"
 gitlab_rails['smtp_port'] = 465
 gitlab_rails['smtp_user_name'] = "XXX@XXX.com"
 gitlab_rails['smtp_password'] = "XX"
 gitlab_rails['smtp_domain'] = "XX.com"
 gitlab_rails['smtp_authentication'] = "login"
 gitlab_rails['smtp_enable_starttls_auto'] = true
 gitlab_rails['smtp_tls'] = true

sudo gitlab-ctl reconfigure

Test sending mail

gitlab-rails console


#Go to the console and send mail
Notify.test_email('593482670@qq.com', 'Mail title', 'Mail text').deliver_now

An error is reported as follows:

OpenSSL::SSL::SSLError (hostname "smtp.wangxiaobao.com" does not match the server certificate)

Solution: modify the / etc/gitlab/gitlab.rb file

gitlab_rails['smtp_openssl_verify_mode'] = 'none'

Sudo gitlab CTL reconfigure, retest.

Email sent successfully!

Landing gitlab

Log in to the address configured by the external_url. To open it for the first time, you need to set the password:

Posted by TPerez on Mon, 11 Nov 2019 13:52:19 -0800