{"id":568,"date":"2014-03-20T01:05:50","date_gmt":"2014-03-19T16:05:50","guid":{"rendered":"http:\/\/lovelinux.mydns.jp\/?p=568"},"modified":"2014-11-07T21:33:03","modified_gmt":"2014-11-07T12:33:03","slug":"how-to-install-gitlab-6-6-5-on-debianubuntu-with-nginx-subdir","status":"publish","type":"post","link":"https:\/\/lovelinux.mydns.jp\/?p=568","title":{"rendered":"How to install GitLab 6.6.5 on debian\/Ubuntu with nginx subdir"},"content":{"rendered":"<p>How to install GitLab 6.6.5 on debian\/Ubuntu with nginx subdir<\/p>\n<p>I introduce you ,how to install GitLab on debian(wheezy) or Ubuntu(12.04 Server or other). Hosting GitLab App in a subdirectory of nginx with using passenger.<\/p>\n<p>I examine this on debian wheezy 7.4 and Ubuntu Server 12.04.4, This way might be a possibility on other debian&#8217;s distribution.<\/p>\n<p>if my introduction is wrong, please post a comment!!<\/p>\n<p>The first half of this article is instration of Rails environment ,because of GitLab is made by Ruby on Rails.the latter half is instration of GitLab and hosting GitLab on nginx subdirectory with fusion passenger.<\/p>\n<h3>Precondition<\/h3>\n<p class=\"point1\"><i class=\"fa fa-hand-o-right\"><\/i>using nginx as a Web server<\/p>\n<p class=\"point1\"><i class=\"fa fa-hand-o-right\"><\/i>Hosting Rails app with nginx and passenger<\/p>\n<p class=\"point1\"><i class=\"fa fa-hand-o-right\"><\/i>GitLab app deploy subdir of nginx<\/p>\n<p class=\"point1\"><i class=\"fa fa-hand-o-right\"><\/i>Hostname of GitLab ***  www.myhost.jp <\/p>\n<p class=\"point1\"><i class=\"fa fa-hand-o-right\"><\/i>Uri of GitLab *** http:\/\/www.myhost.jp\/gitlab <\/p>\n<h3>create git user ,sudo privileges to the user<\/h3>\n<p>[bash]<br \/>\n$ sudo useradd git -md \/home\/git -s \/bin\/bash<br \/>\n$ sudo passwd git<br \/>\n$ sudo nano \/etc\/suders<br \/>\n[\/bash]<\/p>\n<p>grant sudo privileges to git<br \/>\n[diff mark=&#8221;3&#8243; ]<br \/>\n# User privilege specification<br \/>\nroot    ALL=(ALL:ALL) ALL<br \/>\n+ git     ALL=(ALL:ALL) ALL<br \/>\n[\/diff]<\/p>\n<h3>Requirements for installing<\/h3>\n<p>[bash]<br \/>\n$ su &#8211; git<\/p>\n<p>$ 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<\/p>\n<p>[\/bash]<\/p>\n<h3>create .gemrc file<\/h3>\n<p>create ~\/.gemrc file to prevent rdoc and ri installation.<br \/>\n[bash]<br \/>\n$ nano ~\/.gemrc<br \/>\n[\/bash]<\/p>\n<p>[diff]<br \/>\ngem: &#8211;no-ri &#8211;no-rdoc<br \/>\n[\/diff]<\/p>\n<h3>install Ruby and Rails<\/h3>\n<p>minimum requirements for Ruby 1.9.<\/p>\n<p>if the distribution has a ruby package version 1.9 or over.<br \/>\n[bash]<br \/>\n$ sudo apt-get install ruby ruby-dev<br \/>\n$ sudo gem install rails<\/p>\n<p>[\/bash]<\/p>\n<p>Ubuntu 12.04<br \/>\nif the distribution has a ruby package version 1.8.<br \/>\n[bash]<br \/>\n$ sudo apt-get install python-software-properties<br \/>\n$ sudo apt-add-repository ppa:brightbox\/ruby-ng<br \/>\n$ sudo apt-get update<br \/>\n$ sudo apt-get install ruby2.1 ruby2.1-dev<\/p>\n<p>$ sudo gem install rails<br \/>\n[\/bash]<\/p>\n<h3>REDIS configuration,start service<\/h3>\n<p>[bash]<br \/>\n$ sudo service redis-server restart<br \/>\n$ sudo sysv-rc-conf redis-server on<br \/>\n[\/bash]<\/p>\n<p>The latter half is to install GitLab and nginx.<\/p>\n<h3>Installing Gitlab-shell<\/h3>\n<p>[bash]<br \/>\n$ git config &#8211;global user.name &#8220;GitLab&#8221;<br \/>\n$ git config &#8211;global user.email &#8220;gitlab@localhost&#8221;<br \/>\n$ git clone https:\/\/github.com\/gitlabhq\/gitlab-shell.git<br \/>\n$ cd gitlab-shell\/<br \/>\n$ git checkout -b 1.8.5 v1.8.5<br \/>\n$ cp config.yml.example config.yml<br \/>\n$ nano config.yml<br \/>\n[\/bash]<\/p>\n<p>adjust gitlab_url.<\/p>\n<p>[diff]<br \/>\n&#8211; gitlab_url: &#8220;http:\/\/localhost\/&#8221;\u3000<<  remove this line\n+ gitlab_url: \"http:\/\/www.myhost.jp\/gitlab\/\"\n[\/diff]\n\n\nexec installation\n[bash]\n$ .\/bin\/install \n\n[\/bash]\n\n\n\n\n\n\n<h3>Instralling GitLab<\/h3>\n<p>Check out GitLab sources from GitHub.<br \/>\n\uff08It takes about 20 minites.total download size approximates 70MB\uff09<\/p>\n<p>[bash]<\/p>\n<p>$ cd \/home\/git<br \/>\n$ git clone https:\/\/github.com\/gitlabhq\/gitlabhq.git gitlab<br \/>\n$ cd gitlab<br \/>\n$ git checkout -b 6.6.5 v6.6.5<br \/>\n$ cp config\/gitlab.yml.example config\/gitlab.yml<br \/>\n$ nano config\/gitlab.yml<br \/>\n[\/bash]<\/p>\n<h4>Hostname\u3001Relative Url Root<\/h4>\n<p>[diff]<br \/>\n&#8211;   host: localhost<br \/>\n+   host: www.myhost.jp<\/p>\n<p>    https: false<\/p>\n<p>    # Uncomment and customize the last line to run in a non-root path<br \/>\n    # WARNING: We recommend creating a FQDN to host GitLab in a root path instead of this. <\/p>\n<p>    # Note that four settings need to be changed for this to work.<br \/>\n    # 1) In your application.rb file: config.relative_url_root = &#8220;\/gitlab&#8221;<br \/>\n    # 2) In your gitlab.yml file: relative_url_root: \/gitlab<br \/>\n    # 3) In your unicorn.rb: ENV[&#8216;RAILS_RELATIVE_URL_ROOT&#8217;] = &#8220;\/gitlab&#8221;<br \/>\n    # 4) In ..\/gitlab-shell\/config.yml: gitlab_url: &#8220;http:\/\/127.0.0.1\/gitlab&#8221;<br \/>\n    # To update the path, run: sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production<\/p>\n<p>    #<br \/>\n&#8211;    # relative_url_root: \/gitlab<br \/>\n+    relative_url_root: \/gitlab<\/p>\n<p>[\/diff]<\/p>\n<h4>Relative Url Root<\/h4>\n<p>[bash]<br \/>\n$ nano config\/application.rb<br \/>\n[\/bash]<\/p>\n<p>[diff mark=&#8221;2,19&#8243;]<br \/>\n&#8211;    # config.relative_url_root = &#8220;\/gitlab&#8221;<br \/>\n+    config.relative_url_root = &#8220;\/gitlab&#8221;<\/p>\n<p>         *<br \/>\n         *<br \/>\n         *<br \/>\n         *<br \/>\n         *<\/p>\n<p>      end<br \/>\n    end<br \/>\n  end<br \/>\nend<\/p>\n<p>&#8211;<br \/>\n+ ENV[&#8216;RAILS_RELATIVE_URL_ROOT&#8217;] = &#8220;\/gitlab&#8221;<\/p>\n<p>[\/diff]<\/p>\n<h4>Mysql configuration<\/h4>\n<p>adjust user name and password for Production mode.<br \/>\n[bash]<br \/>\n$ cp config\/database.yml.mysql config\/database.yml<br \/>\n$ nano config\/database.yml<br \/>\n[\/bash]<\/p>\n<p>[diff]<br \/>\n\t#<br \/>\n\t# PRODUCTION<br \/>\n\t#<br \/>\n\tproduction:<br \/>\n\t  adapter: mysql2<br \/>\n\t  encoding: utf8<br \/>\n\t  reconnect: false<br \/>\n\t  database: gitlabhq_production<br \/>\n\t  pool: 10<br \/>\n&#8211;\t  username: git<br \/>\n&#8211;\t  password: &#8220;secure password&#8221;<br \/>\n+\t  username: root<br \/>\n+\t  password: &#8220;xxxxxxxxx&#8221;<br \/>\n\t  # host: localhost<br \/>\n\t  # socket: \/tmp\/mysql.sock<br \/>\n[\/diff]<\/p>\n<h4>Run bundle install <\/h4>\n<p>[bash]<br \/>\n$ bundle install &#8211;deployment &#8211;without development test postgres<br \/>\n[\/bash]<\/p>\n<h4>Create Directories<\/h4>\n<p>[bash]<br \/>\n$ mkdir \/home\/git\/gitlab\/tmp\/pids<br \/>\n$ mkdir \/home\/git\/gitlab\/public\/uploads<br \/>\n[\/bash]<\/p>\n<h4>Create database<\/h4>\n<p>[bash]<br \/>\n$ rake db:create RAILS_ENV=production<br \/>\n$ rake gitlab:setup RAILS_ENV=production<\/p>\n<p>[\/bash]<\/p>\n<p>if the creation complete, user name and password are shown.<br \/>\nplease put it down.<\/p>\n<p>login&#8230;&#8230;&#8230;admin@local.host<br \/>\npassword&#8230;&#8230;5iveL!fe<\/p>\n<h4>Create a service script and configuration<\/h4>\n<p>By default, Application server of GitLab is puma. But I use fusion passenger as Application server.<br \/>\nSo I create a service script of GitLab(sidekiq)<\/p>\n<p>please download from this site.<\/p>\n<p>[bash]<br \/>\n$ wget http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/03\/gitlab.sh<\/p>\n<p>$ sudo cp gitlab.sh \/etc\/init.d\/gitlab<br \/>\n$ sudo chmod 744 \/etc\/init.d\/gitlab<br \/>\n$ sudo sysv-rc-conf gitlab on<\/p>\n<p>$ sudo service gitlab start<br \/>\n[\/bash]<\/p>\n<h3>Instralling nginx<\/h3>\n<p>Compiling nginx for cooperation with passenger.<\/p>\n<h3>Installing passenger gem<\/h3>\n<p>[bash]<br \/>\n$ sudo gem install passenger<br \/>\n[\/bash]<\/p>\n<h3>Compiling nginx<\/h3>\n<p>[bash]<br \/>\n$ sudo passenger-install-nginx-module<br \/>\n[\/bash]<\/p>\n<p>Pass the checking requirements for compilation, a message is shown whether if you continue compile?<br \/>\nplease select 1.<\/p>\n<p>[bash]<br \/>\nPlease specify a prefix directory [\/opt\/nginx]:<\/p>\n<p>Nginx with Passenger support was successfully installed.<\/p>\n<p>The Nginx configuration file (\/opt\/nginx\/conf\/nginx.conf)<br \/>\nmust contain the correct configuration options in order for Phusion Passenger<br \/>\nto function correctly.<\/p>\n<p>This installer has already modified the configuration file for you! The<br \/>\nfollowing configuration snippet was inserted:<\/p>\n<p>  http {<br \/>\n      &#8230;<br \/>\n      passenger_root \/var\/lib\/gems\/1.9.1\/gems\/passenger-4.0.39;<br \/>\n      passenger_ruby \/usr\/bin\/ruby1.9.1;<br \/>\n      &#8230;<br \/>\n  }<\/p>\n<p>After you start Nginx, you are ready to deploy any number of Ruby on Rails<br \/>\napplications on Nginx.<\/p>\n<p>[\/bash]<\/p>\n<h3>permission of \/opt\/nginx <\/h3>\n<p>[bash]<br \/>\n$ sudo chown www-data:www-data \/opt\/nginx -R<br \/>\n$ sudo chmod 775 \/opt\/nginx -R<br \/>\n[\/bash]<\/p>\n<h3>check configration of nginx, start service<\/h3>\n<p>checking the configration of nginx with -t option.<br \/>\nIf configuration is OK, test with a browser.<br \/>\nBy accessing http:\/\/localhost in browser,top page of nginx is shown,test is complete.<\/p>\n<p>[bash]<br \/>\n$ sudo \/opt\/nginx\/sbin\/nginx -t<br \/>\nnginx: the configuration file \/opt\/nginx\/conf\/nginx.conf syntax is ok<br \/>\nnginx: configuration file \/opt\/nginx\/conf\/nginx.conf test is successful<\/p>\n<p>$ sudo \/opt\/nginx\/sbin\/nginx<br \/>\n[\/bash]<\/p>\n<p>check process id(pid) of nginx master.<br \/>\n[bash]<br \/>\n$ ps aux |grep nginx<br \/>\n[\/bash]<\/p>\n<p>kill process of nginx : master process<br \/>\n[bash]<br \/>\n$ sudo kill pid<br \/>\n[\/bash]<\/p>\n<h3>nginx cooperate with passenger<\/h3>\n<p>[bash]<br \/>\n$ sudo nano \/opt\/nginx\/conf\/nginx.conf<br \/>\n[\/bash]<\/p>\n<p>Add these lines to nginx.conf<br \/>\n<strong>Attension\uff01\uff01\uff01 line of pid,  separate pid and \/opt\/nginx\/logs\/nginx.pid with tab char!\uff01<\/strong><br \/>\nbecause service script of nginx reads this line ,and judge pid by the tab char.<\/p>\n<p>[diff mark=&#8221;2&#8243;]<br \/>\n+ user  www-data;<br \/>\n+ pid \/opt\/nginx\/logs\/nginx.pid;<\/p>\n<p>       *<br \/>\n       *<br \/>\n       *<br \/>\n       *<\/p>\n<p>    server {<br \/>\n        listen       80;<br \/>\n        server_name  localhost;<\/p>\n<p>       *<br \/>\n       *<br \/>\n       *<br \/>\n       *<\/p>\n<p>&#8211;<br \/>\n+        location ~ ^\/gitlab {<br \/>\n+              root \/home\/git\/gitlab\/public;<br \/>\n+              #passenger_base_uri \/gitlab;<br \/>\n+              passenger_app_root \/home\/git\/gitlab;<br \/>\n+              #passenger_document_root \/home\/git\/gitlab\/public;<br \/>\n+              passenger_enabled on;<br \/>\n+              rails_env production;<br \/>\n+              access_log  \/opt\/nginx\/logs\/gitlab.access.log;<br \/>\n+              error_log  \/opt\/nginx\/logs\/gitlab.error.log;<br \/>\n+        }<\/p>\n<p>       *<br \/>\n       *<br \/>\n       *<br \/>\n       *<\/p>\n<p>[\/diff]<\/p>\n<h3>Service Script of nginx<\/h3>\n<p>I create a service script of nginx.<\/p>\n<p>the script can downlaod from here.<br \/>\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/03\/nginx\">Service script of nginx<\/a><\/p>\n<p>[diff mark=&#8221;14,28&#8243;]<br \/>\n#!\/bin\/sh<\/p>\n<p>### BEGIN INIT INFO<br \/>\n# Provides:\t  nginx<br \/>\n# Required-Start:    $local_fs $remote_fs $network $syslog $named<br \/>\n# Required-Stop:     $local_fs $remote_fs $network $syslog $named<br \/>\n# Default-Start:     2 3 4 5<br \/>\n# Default-Stop:      0 1 6<br \/>\n# Short-Description: starts the nginx web server<br \/>\n# Description:       starts nginx using start-stop-daemon<br \/>\n### END INIT INFO<\/p>\n<p>PATH=\/usr\/local\/sbin:\/usr\/local\/bin:\/sbin:\/bin:\/usr\/sbin:\/usr\/bin<br \/>\nDAEMON=\/opt\/nginx\/sbin\/nginx<br \/>\nNAME=nginx<br \/>\nDESC=nginx<\/p>\n<p># Include nginx defaults if available<br \/>\nif [ -r \/etc\/default\/nginx ]; then<br \/>\n\t. \/etc\/default\/nginx<br \/>\nfi<\/p>\n<p>test -x $DAEMON || exit 0<\/p>\n<p>. \/lib\/init\/vars.sh<br \/>\n. \/lib\/lsb\/init-functions<\/p>\n<p>PID=$(awk -F'[ \\t;]&#8217; &#8216;$1 !~ \/^#\/ &amp;&amp; \/pid\/ {print $2}&#8217; \/opt\/nginx\/conf\/nginx.conf)<\/p>\n<p>if [ -z &#8220;$PID&#8221; ]<br \/>\nthen<br \/>\n\tPID=\/run\/nginx.pid<br \/>\nfi<\/p>\n<p># Check if the ULIMIT is set in \/etc\/default\/nginx<br \/>\nif [ -n &#8220;$ULIMIT&#8221; ]; then<br \/>\n\t# Set the ulimits<br \/>\n\tulimit $ULIMIT<br \/>\nfi<\/p>\n<p>#<br \/>\n# Function that starts the daemon\/service<br \/>\n#<br \/>\ndo_start()<br \/>\n{<\/p>\n<p>      *<br \/>\n      *<br \/>\n      *<br \/>\n      *<br \/>\n      *<br \/>\n      *<\/p>\n<p>[\/diff]<\/p>\n<h3>Copy the script and service registration <\/h3>\n<p>[bash]<\/p>\n<p>$ sudo mv nginx \/etc\/init.d\/<br \/>\n$ sudo chmod 755 \/etc\/init.d\/nginx<br \/>\n$ sudo chown root:root \/etc\/init.d\/nginx<\/p>\n<p>$ sudo sysv-rc-conf nginx on<\/p>\n<p>[\/bash]<\/p>\n<p>if you want start or stop or restart nginx,following commands are available.<\/p>\n<p>[bash]<\/p>\n<p>sudo \/etc\/init.d\/nginx start<br \/>\nsudo \/etc\/init.d\/nginx stop<br \/>\nsudo \/etc\/init.d\/nginx restart<br \/>\n[\/bash]<\/p>\n<p>or <\/p>\n<p>[bash]<\/p>\n<p>sudo service nginx start<br \/>\n[\/bash]<\/p>\n<h4>modification of nginx(www-data)<\/h4>\n<p>to access \/home\/git\/repositories\u3000folder ,add nginx user to git group.<\/p>\n<p>[bash]<br \/>\n$ sudo usermod -aG git www-data<\/p>\n<p>[\/bash]<\/p>\n<h4>Precompile of assets<\/h4>\n<p>after precompiling, please restart nginx service.<\/p>\n<p>[bash]<br \/>\n$ cd \/home\/git\/gitlab<br \/>\n$ sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production<\/p>\n<p>$ sudo service nginx restart<br \/>\n[\/bash]<\/p>\n<h3>Now, Check the GitLab!!<\/h3>\n<p>With a browser,accsess to http:\/\/www.myhost.jp\/gitlab<\/p>\n<p><a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/01\/Screenshot-GitLab-Chromium.png\"><img decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/01\/Screenshot-GitLab-Chromium.png\" alt=\"Screenshot-GitLab - Chromium\" width=\"650\" class=\"alignnone size-medium wp-image-141\" \/><\/a><\/p>\n<p><P>Login to GitLab<\/P><\/p>\n<p>login&#8230;&#8230;&#8230;admin@local.host<br \/>\npassword&#8230;&#8230;5iveL!fe<\/p>\n<h3>Create a Project(repository)<\/h3>\n<p><a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/01\/Screenshot-Dashboard-GitLab-Chromium.png\"><img decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/01\/Screenshot-Dashboard-GitLab-Chromium.png\" alt=\"Screenshot-Dashboard | GitLab - Chromium\" width=\"650\" class=\"alignnone size-medium wp-image-140\" \/><\/a><\/p>\n<p><a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/01\/Screenshot-New-Project-GitLab-Chromium.png\"><img decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/01\/Screenshot-New-Project-GitLab-Chromium.png\" alt=\"Screenshot-New Project | GitLab - Chromium\" width=\"650\" class=\"alignnone size-medium wp-image-142\" \/><\/a><\/p>\n<p>Check if the repository is created.<\/p>\n<p>[bash]<br \/>\n# ls \/home\/git\/repositories\/root\/<br \/>\nabc.git  abc.wiki.git<br \/>\n[\/bash]<\/p>\n<p>if the repository is not properly created.<br \/>\nRecreate a repository ,after restart service of GitLab.<\/p>\n<p>[bash]<br \/>\n# service gitlab restart<br \/>\n[\/bash]<\/p>\n<h3>Push to repository from other PC<\/h3>\n<p>Create a directory,and init Git repository.and create a sample file named README.<br \/>\nExamine to push to GitLab.<\/p>\n<p>[bash]<br \/>\n$ mkdir abc<br \/>\n$ cd abc<br \/>\n$ git init<br \/>\nInitialized empty Git repository in \/home\/hiro\/workspace\/abc\/.git\/<\/p>\n<p>$ git config user.name &#8220;myname&#8221;<br \/>\n$ git config user.email &#8220;myname@myhost.jp&#8221;<br \/>\n$ git remote add origin http:\/\/root@www.myhost.jp\/gitlab\/root\/abc.git<\/p>\n<p>$ echo &#8220;HELLO GITLAB&#8221; >>README<br \/>\n$ git add README<br \/>\n$ git commit -m &#8220;first commit&#8221;<br \/>\n$ git push -u origin master<\/p>\n<p>[\/bash]<\/p>\n<h3>Check the commit with Browser<\/h3>\n<p><a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/01\/Screenshot-Commits-at-master-Administrator-abc-GitLab-Chromium.png\"><img decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/01\/Screenshot-Commits-at-master-Administrator-abc-GitLab-Chromium.png\" alt=\"Screenshot-Commits at master - Administrator - abc | GitLab - Chromium\" width=\"650\" class=\"alignnone size-medium wp-image-139\" \/><\/a><\/p>\n<p><a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/01\/Screenshot-Administrator-abc-GitLab-Chromium.png\"><img decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/01\/Screenshot-Administrator-abc-GitLab-Chromium.png\" alt=\"Screenshot-Administrator - abc | GitLab - Chromium\" width=\"650\"  class=\"alignnone size-medium wp-image-138\" \/><\/a><\/p>\n<p>Congratulations!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to install GitLab 6.6.5 on debian\/Ubuntu with nginx subdir I introduce you ,how to install GitLab on debian(wheezy) or Ubuntu(12.04 Server or other). Hosting GitLab App in a subdirectory of nginx with using passenger. I examine this on debian wheezy 7.4 and Ubuntu Server 12.04.4, This way might be a possibility on other debian&#8217;s distribution. if my introduction is wrong, please post a comment!! The first half of this article is instration of Rails environment ,because of GitLab is made by Ruby on Rails.the latter half is instration of GitLab and hosting GitLab on nginx subdirectory with fusion passenger. Precondition using nginx as a Web server Hosting Rails app with nginx and passenger GitLab app deploy subdir of nginx Hostname of GitLab *** www.myhost.jp Uri of GitLab *** http:\/\/www.myhost.jp\/gitlab create git user ,sudo privileges to the user [bash] $ sudo useradd git -md \/home\/git -s \/bin\/bash $ sudo passwd git $ sudo nano \/etc\/suders [\/bash] grant sudo privileges to git [diff mark=&#8221;3&#8243; ] # User privilege specification root ALL=(ALL:ALL) ALL + git ALL=(ALL:ALL) ALL [\/diff] Requirements for installing [bash] $ su &#8211; 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 [\/bash] create .gemrc file create ~\/.gemrc file to prevent rdoc and ri installation. [bash] $ nano ~\/.gemrc [\/bash] [diff] gem: &#8211;no-ri &#8211;no-rdoc [\/diff] install Ruby and Rails minimum requirements for Ruby 1.9. if the distribution has a ruby package version 1.9 or over. [bash] $ sudo apt-get install ruby ruby-dev $ sudo gem install rails [\/bash] Ubuntu 12.04 if the distribution has a ruby package version 1.8. [bash] $ sudo apt-get install python-software-properties $ sudo apt-add-repository ppa:brightbox\/ruby-ng $ sudo apt-get update $ sudo apt-get install ruby2.1 ruby2.1-dev&#8230;<\/p>\n","protected":false},"author":1,"featured_media":558,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[4],"tags":[32,12,13,19],"class_list":{"0":"post-568","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-4","8":"tag-debian","9":"tag-gitlab","10":"tag-nginx","11":"tag-ubuntu"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/568","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=568"}],"version-history":[{"count":13,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/568\/revisions"}],"predecessor-version":[{"id":1051,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/568\/revisions\/1051"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/media\/558"}],"wp:attachment":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}