• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Install GitLab on Ubuntu on Nginx Subdirectory (HP Cloud)

By Abhishek Ghosh May 26, 2015 6:17 pm Updated on May 26, 2015

Install GitLab on Ubuntu on Nginx Subdirectory (HP Cloud)

Advertisement

Lot of Conditions – Install GitLab on Ubuntu on Nginx Subdirectory HP Cloud. It is possible to install Gitlab in Subdirectory on Nginx but is Complicated. You should be an advanced user and have a good server admin for the server, particularly if the root has WordPress. Nginx will need fresh compiling again. It is not really very easy. Most of the websites nowadays in favor of using subdirectory instead of subdomain due to increased number of HTTPS and HSTS websites.

 

Install GitLab on Ubuntu on Nginx Subdirectory (HP Cloud)

 

If it is HP Cloud / OpenStack installation, take a snapshot before proceeding. We are using Nginx as a Web server to host Rails app with Nginx and Passenger. Just the commands :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
apt update -y && apt upgrade
# apt-get update -y && apt-get upgrade
sudo useradd git -md /home/git -s /bin/bash
sudo passwd git
sudo nano /etc/sudoers
## check/add these lines
# root    ALL=(ALL:ALL) ALL
# git     ALL=(ALL:ALL) ALL
## we gave sudo privilege to git. you can add username if you want.
# username   ALL=(ALL:ALL) ALL
## end comment
su -git
sudo apt-get install curl git build-essential libgtk2.0-dev libmysqlclient-dev mysql-server dialog zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl git-core openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev python-docutils sysv-rc-conf
nano ~/.gemrc
# paste it
# gem: --no-ri --no-rdoc
# save and exit nano
sudo apt-get install ruby ruby-dev && sudo gem install rails
sudo apt-get install python-software-properties
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt-get update -y
sudo apt-get install ruby2.1 ruby2.1-dev
sudo gem install rails
sudo service redis-server restart && sudo sysv-rc-conf redis-server on
git config --global user.name "GitLab"
# edit
git config --global user.email "gitlab@localhost.tld"
git clone https://github.com/gitlabhq/gitlab-shell.git
cd gitlab-shell/
# change according to need
git checkout -b 1.8.5 v1.8.5
cp config.yml.example config.yml
nano config.yml
# edit the line gitlab_url: to indicate your subdomain with domain name
./bin/install
git clone https://github.com/gitlabhq/gitlabhq.git gitlab
cd gitlab
# tested version
git checkout -b 6.6.5 v6.6.5
cp config/gitlab.yml.example config/gitlab.yml
nano config/gitlab.yml
# host: www.something.tld
# https: false or true
# relative_url_root: /subdir_name
## change subdir_name to real
nano config/application.rb
# config.relative_url_root = "/subdir_name"
# ENV['RAILS_RELATIVE_URL_ROOT'] = "/subdir_name"
cp config/database.yml.mysql config/database.yml
nano config/database.yml
# username: root
# password: "yours"
bundle install --deployment --without development test postgres
mkdir /home/git/gitlab/tmp/pids && mkdir /home/git/gitlab/public/uploads
rake db:create RAILS_ENV=production
rake gitlab:setup RAILS_ENV=production
wget https://gist.githubusercontent.com/AbhishekGhosh/77ffb178005b70eb694f/raw/943c3209df9621ca6c196d513fb4209ae7165b1f/gitlab.sh
# read it to edit
# nano gitlab.sh
chmod +x gitlab.sh
sudo cp gitlab.sh /etc/init.d/gitlab
sudo chmod 744 /etc/init.d/gitlab
sudo sysv-rc-conf gitlab on
sudo service gitlab start
sudo gem install passenger && sudo passenger-install-nginx-module
# select option in prompt carefully
# edit path
wget https://gist.githubusercontent.com/AbhishekGhosh/2113e134b3e91b34f300/raw/9776e6bedec87bc8a333b7cdcc3f0405b4cb31b2/nginx
sudo chown www-data:www-data /opt/nginx -R
sudo chmod 775 /opt/nginx -R
sudo mv nginx /etc/init.d/
sudo chmod 755 /etc/init.d/nginx
sudo chown root:root /etc/init.d/nginx
sudo sysv-rc-conf nginx on
nginx -t
# service nginx start

Install GitLab on Ubuntu on Nginx Subdirectory (HP Cloud)

Now configuring Nginx’s nginx.conf file :

Advertisement

---

Vim
1
2
3
4
5
6
7
8
location ~ ^/gitlab {
    root /home/git/gitlab/public;
    passenger_app_root /home/git/gitlab;
    passenger_enabled on;
    rails_env production;
    access_log  /opt/nginx/logs/gitlab.access.log;
    error_log  /opt/nginx/logs/gitlab.error.log;
    }

Vim
1
2
3
cd /home/git/gitlab
sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
sudo service nginx restart

Point your browser to subdir to check whether its working or not. Debugging will be needed. We read it somewhere in a Jap website with Google Translate for our internal need.

Tagged With gitlab 8 subdir , gitlab https subdirectory , gitlab nginx subdir , gitlab subfolder ngix , paperuri:(f5a42fdee605ea283242576b6876440c)
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Install GitLab on Ubuntu on Nginx Subdirectory (HP Cloud)

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • Ansible Ubuntu 16.04 1 Click Install WordPress, Nginx Playbook Tutorial

    Following This Tutorial, You Will Be Able to Create Own Ansible 1 Click Install WordPress Nginx Percona MySQL Playbook For Ubuntu 16.04.

  • Installing Gitlab on Rackspace Cloud Server

    Installing Gitlab on Rackspace Cloud Server using a single server Debian instance with 1 GB RAM is quite easy. Here are the steps with commands.

  • WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud

    Here is a Step by Step Guide on Setting Up WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud with All Commands and the Configuration.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy