One-click GitLab7 installation on RHEL6.4

Source: Internet
Author: User
Tags nginx host redmine fully qualified domain name
Reference: Workshop. Bitnami (https://bitnami.com/) one-click installation package can solve the big problem, but there are still many people can not configure gitlab + nginx and E-mail sending and so on. Today, I made a thorough review. Questions for all readers

Http://www.linuxidc.com/Linux/2014-08/105137.htm ()

1 about gitlab7

Gitlab is a good thing in any case, but it is extremely difficult to install and configure. Bitnami (https://bitnami.com/) one-click installation package can solve the big problem, but there are still many people can not configure gitlab + nginx and E-mail sending and so on. Today, I made a thorough review. I will not answer your questions one by one.

First, some versions of bitmami have problems and cannot be successfully installed on rhel6.4. Therefore, I found a newer version 7.8.1 (responsive page) that can be used ):

Ftp://pepstack.com/pub/tarball/bitnami-gitlab-7.8.1-0-linux-x64-installer.run

(My ftp will not be provided all the time. Please download it as soon as possible)

Then, the effect of the last installation is (click to access, the first access may be slow, requiring a newer version of firefox or chrome, IE not tested ):

Http://pepstack.com/gitlab

2 Requirement Description

Well, let's first describe the requirement. If the reader's requirements are different from mine, I can't do anything. Suppose I have a web host (pepstack.com here), I create a virtual machine (vm-gitlab) behind the host, and install gitlab7 on the vm-gitlab, then, by configuring ngnix on the web host, you can access my gitlab through the following url:

Http://pepstack.com/gitlab

The process of creating vm-gitlab is not detailed. If you use a physical machine, the same is true. The vm-gitlab is installed with rhel6.4. Make sure that you can access external hosts and the internet (such as ping www.baidu.com) within the vm ).

3. Install gitlab

Ssh to vm-gitlab:

# Ssh root @ vm-gitlab

Download the one-click installation package:

# Wget ftp://pepstack.com/pub/tarball/bitnami-gitlab-7.8.1-0-linux-x64-installer.run

Installation:

# Chmod a + x bitnami-gitlab-7.8.1-0-linux-x64-installer.run

#./Bitnami-gitlab-7.8.1-0-linux-x64-installer.run

The following message is displayed during installation:

----------------------------------------------------------------------------
Welcome to the Bitnami Gitlab Stack Setup Wizard.

----------------------------------------------------------------------------
Select the components you want to install; clear the components you do not want
To install. Click Next when you are ready to continue.

GitLab: Y (Cannot be edited)

GitLab CI [Y/n]: Y

Is the selection above correct? [Y/n]: Y

----------------------------------------------------------------------------
Installation folder

Please, choose a folder to install Bitnami Gitlab Stack

Select a folder [/opt/gitlab-7.8.1-0]:

----------------------------------------------------------------------------
Create Admin account

Bitnami Gitlab Stack admin user creation

Email Address [user@example.com]: cheungmine@qq.com

Login [user]: master (here is the user name you used to log on to gitlab)

Password: (enter the Password you used to log on to gitlab)
Please confirm your password: (enter the password you want to use when logging on to gitlab)
----------------------------------------------------------------------------
Hostname that will be used to create internal URLs. If this value is incorrect,
You may be unable to access your Gitlab installation from other computers. It is
Advisable to use a Domain instead of an IP address for compatibility
Different browsers.

Domain [127.0.0.1]:

Do you want to configure mail support? [Y/N]: Y

----------------------------------------------------------------------------
Configure SMTP Settings

This is required so your application can send notifications via email.

Default email provider:

[1] GMail
[2] Custom
Please choose an option [1]: 2

----------------------------------------------------------------------------
Configure SMTP Settings

This data is stored in the application configuration files and may be visible
Others. For this reason, it is recommended that you do not use your personal
Account credentials.

Username []: cheungmine@qq.com

Password: (enter your QQ Password)
Re-enter: (enter your QQ password)
SMTP Host []: smtp.qq.com

SMTP Port []: 25

Secure connection

[1] None
[2] SSL
[3] TLS
Please choose an option [3]:

----------------------------------------------------------------------------
Setup is now ready to begin installing Bitnami Gitlab Stack on your computer.

Do you want to continue? [Y/n]: Y

----------------------------------------------------------------------------
Please wait while Setup instils Bitnami Gitlab Stack on your computer.

Installing
0% ______________ 50% ______________ 100%
######################################## #

----------------------------------------------------------------------------
Setup has finished installing Bitnami Gitlab Stack on your computer.

Info: To access the Bitnami Gitlab Stack, go
Http: // 127.0.0.1: 80 from your browser.
Press [Enter] to continue:

4. Configure gitlab
Be especially careful when configuring. The following configuration files are used:

/Opt/gitlab-7.8.1-0/apps/gitlab/htdocs/config/environments/production. rb
// Opt/gitlab-7.8.1-0/apps/gitlab/htdocs/config/initializers/smtp_settings.rb
/Opt/gitlab-7.8.1-0/apps/gitlab/htdocs/config/gitlab. yml
/Opt/gitlab-7.8.1-0/apps/gitlab/conf/httpd-app.conf
/Opt/gitlab-7.8.1-0/apps/gitlab-shell/config. yml

The following are explained one by one:

4.1 production. rb

......
# Config. action_mailer.delivery_method =: sendmail
# Defaults:
# Config. action_mailer.sendmail_settings = {
# Location: '/usr/sbin/sendmail ',
# Arguments: '-I-t'
##}
Config. action_mailer.m_m_deliveries = true
Config. action_mailer.raise_delivery_errors = true
Config. action_mailer.delivery_method =: smtp
Config. action_mailer.smtp_settings = {
: Address => "smtp.qq.com ",
: Port => "25 ",
: Domain => "qq.com ",
: Authentication =>: plain,
: User_name => "cheungmine@qq.com ",
: Password => "********",
: Enable_starttls_auto => true
}

Config. eager_load = true
Config. assets. js_compressor =: uglifier

Config. allow_concurrency = false
......

4.2 smtp_settings.rb
# Cp smtp_settings.rb.sample smtp_settings.rb

# To enable smtp email delivery for your GitLab instance do the following:
#1. Rename smtp_settings.rb.sample to smtp_settings.rb
#2. Edit settings inside this file
#3. Restart GitLab instance
#
If Rails. env. production?
Gitlab: Application. config. action_mailer.delivery_method =: smtp

ActionMailer: Base. smtp_settings = {
Address: "smtp.qq.com ",
Port: 25,
User_name: "cheungmine@qq.com ",
Password :"********",
Domain: "qq.com ",
Authentication: login,
Enable_starttls_auto: true,
Openssl_verify_mode: 'none'
}
End

4.3 gitlab. yml

##################
# GitLab application config file #
##################
#
# How to use:
#1. Copy file as gitlab. yml
#2. Update gitlab-> host with your fully qualified domain name
#3. Update gitlab-> email_from
#4. If you installed Git from source, change git-> bin_path to/usr/local/bin/git
#5. Review this configuration file for other settings you may want to adjust

Production: & base
#
#1. GitLab app settings
#======================================

# GitLab settings
Gitlab:
# Web server settings (note: host is the FQDN, do not include http ://)
Host: pepstack.com
Port: 80 # Set to 443 if using HTTPS, see installation. md # using-https for additional HTTPS configuration details
Https: false # Set to true if using HTTPS, see installation. md # using-https for additional HTTPS configuration details

# Uncommment this line below if your ssh host is different from HTTP/HTTPS one
# (You 'd obviously need to replace ssh. host_example.com with your own host ).
# Otherwise, ssh host will be set to the 'host: 'value above
# Ssh_host: ssh. host_example.com

# WARNING: See config/application. rb under "Relative url support" for the list
# Other files that need to be changed for relative url support
Relative_url_root:/gitlab

# Uncomment and customize if you can't use the default user to run GitLab (default: 'git ')
# User: git

# Date & Time settings
# Uncomment and customize if you want to change the default time zone of GitLab application.
# To see all available zones, run 'bundle exec rake time: zones: all RAILS_ENV = production'
# Time_zone: 'utc'

# Email settings
# Uncomment and set to false if you need to disable email sending from GitLab (default: true)
# Email_enabled: true
# Email address used in the "From" field in mails sent by GitLab
Email_from: cheungmine@qq.com
Support_email: cheungmine@qq.com

# Email server smtp settings are in config/initializers/smtp_settings.rb.sample

# Default_can_create_group: false # default: true
# Username_changing_enabled: false # default: true-User can change her username/namespace
# Default theme
# BASIC = 1
# MARS = 2
# MODERN = 3
# GRAY = 4
# COLOR = 5
# Default_theme: 2 # default: 2
......

The above file is changed:

Host: pepstack.com
Relative_url_root:/gitlab
Email_from: cheungmine@qq.com
Support_email: cheungmine@qq.com

The following configuration is used to place gitlab behind nginx:

4.4 httpd-app.conf


Options-MultiViews
AllowOverride All

Order allow, deny
Allow from all

= 2.3>
Require all granted

SetEnv RAILS_RELATIVE_URL_ROOT "/gitlab"

PassengerEnabled on
PassengerAppRoot "/opt/gitlab-7.8.1-0/apps/gitlab/htdocs /"

ModPagespeedDisallow "*"

PassengerUser git
PassengerGroup git
SetEnv MAGIC "/opt/gitlab-7.8.1-0/ruby/lib/ruby/gems/2.0.0/gems/charlock_holmes-0.6.9.4/ext/charlock_holmes/src/file-5.08/magic. mgc"
SetEnv PATH "/opt/gitlab-7.8.1-0/python/bin: $ {PATH }"



PassengerPreStart http: // 127.0.0.1: 80/gitlab

The difference is:

SetEnv RAILS_RELATIVE_URL_ROOT "/gitlab"
PassengerPreStart http: // 127.0.0.1: 80/gitlab

4.5 config. yml

...
Gitlab_url: http://pepstack.com: 80/gitlab/
...

In this case, the following address is used to access gitlab:

Http://pepstack.com/gitlab/

5 Host nginx Configuration

The above configurations are all performed on vm-gitlab. Note that port 80: http is enabled. Add the configuration file to the nginx Host:

/Etc/nginx/conf. d/redmine. conf

The content is as follows (I also provide the redmine Service ):

# Point to the Intranet redmine web Service (192.168.122.21: 80)
#
Upstream redmine {
Server 192.168.122.21: 80;
}

Upstream gitlab {
Server 192.168.122.20: 80;
}

Server {
Server_name pepstack.com;

#/Var/log/nginx local directory must exist
Access_log/var/log/nginx/redmine_access.log;
Error_log/var/log/nginx/redmine_error.log;

Location/redmine {
Try_files $ uri @ red; # @ red the name is arbitrary.
}

Location/gitlab {
Try_files $ uri @ git;
}

Location @ red {
Proxy_set_header Host $ host;
Proxy_set_header Co., X-Real_IP $ remote_addr;
Proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for;

Proxy_read_timeout 300;
Proxy_connect_timeout 300;
Proxy_redirect off;

Proxy_pass http: // redmine; # point to upstream redmine
}

Location @ git {
Proxy_set_header Host $ host;
Proxy_set_header Co., X-Real_IP $ remote_addr;
Proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for;

Proxy_read_timeout 300;
Proxy_connect_timeout 300;
Proxy_redirect off;

Proxy_pass http: // gitlab; # point to upstream gitlab
}
}

Comment out: include/etc/nginx/sites-enabled /*;

6. Start the service

As a result, start nginx on the host:

$ Sudo nginx-s reload

Start gitlab in vm-gitlab:

# Gitlab-7.8.1-0/cd/opt/

#./Ctlscript. sh restart

CentOS source code installation GitLab Chinese edition http://www.linuxidc.com/Linux/2015-10/124648.htm

Install GitLab http://www.linuxidc.com/Linux/2012-12/75249.htm on Ubuntu 12.04

GitLab 5.3 upgrade considerations http://www.linuxidc.com/Linux/2013-06/86473.htm

Deploy GitLab (self-managed Git project repository) http://www.linuxidc.com/Linux/2013-06/85754.htm on CentOS

Install the GitLab 6.0.2 http://www.linuxidc.com/Linux/2014-03/97831.htm on RHEL6/CentOS6/ScientificLinux6

CentOS 6.5 GitLab installation tutorial and Related Problem Solving http://www.linuxidc.com/Linux/2014-05/101526.htm

GitLab details: Click here
GitLab's: Click here

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-11/124919.htm

Related Article

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.