I got this working pretty easily using nginx. Here are the relevant
sections from my config files:

*nginx*

upstream gitlab {
  server unix:/home/git/gitlab/tmp/sockets/gitlab.socket fail_timeout=0;
}

location /gitlab {
      alias /home/git/gitlab/public;
      # serve static files from defined root folder;.
      # @gitlab is a named location for the upstream fallback, see below
      try_files $uri $uri/index.html $uri.html @gitlab;
}

location @gitlab {
     proxy_read_timeout 3000; # Some requests take more than 30 seconds.
     proxy_connect_timeout 3000; # Some requests take more than 30 seconds.
     proxy_redirect     off;

     proxy_set_header   Host              $http_host;
     proxy_set_header   X-Real-IP         $remote_addr;
     proxy_set_header   X-Forwarded-For   $proxy_add_x_forwarded_for;
     proxy_set_header   X-Forwarded-Proto $scheme;
     proxy_set_header   X-Frame-Options   SAMEORIGIN;

     proxy_pass http://gitlab;
}

*Follow the instructions in a few of the config files:*

 # Relative url support
 # Uncomment and customize the last line to run in a non-root path
 # WARNING: We recommend creating a FQDN to host GitLab in a root path
instead of this.
 # Note that following settings need to be changed for this to work.
 # 1) In your application.rb file: config.relative_url_root = "/gitlab"
 # 2) In your gitlab.yml file: relative_url_root: /gitlab
 # 3) In your unicorn.rb: ENV['RAILS_RELATIVE_URL_ROOT'] = "/gitlab"
 # 4) In ../gitlab-shell/config.yml: gitlab_url: "http://127.0.0.1/gitlab";
 # 5) In lib/support/nginx/gitlab : do not use asset gzipping, remove block
starting with "location ~ ^/(assets)/"
 #
 # To update the path, run: sudo -u git -H bundle exec rake
assets:precompile RAILS_ENV=production


This worked just fine for me.

On Mon Nov 17 2014 at 9:52:58 AM Ryan W <[email protected]> wrote:

> I have lost weeks of my life trying to accomplish this and I can say
> without hesitation that you are so much better off to go to
> digitalocean.com or amazon and setup a stand alone instance.. It
> literally takes 90 seconds and you will spend hours and days trying to get
> it working properly on a production server and chances are you will
> probably muck up the existing apache/nginx installation and take your sites
> down in teh process.
>
> In terms of which cloud service to use I went with DigitalOcean as they
> provide 30GB of SSD space, 1GB of ram(you will need to add 1-2GB of swap)
> and 2TB per month of transfer.  If you aren't hosting a large repo(s) that
> need a lot of data transfer then amazon will let you set up a comparable
> instance for free for a year, the only time they are really going to get
> you is if you are xfering a lot of data.  Both services are insanely easy
> to get gitlab up and running on
>
> I can't recommend this enough, I wasted weeks of my life and thousands of
> dollars in my experimentation to get Gitlab working on one of our web
> servers and in the end it never even worked properly.  I spend 90 seconds
> on digital ocean and it works immediately.
>
> On Sunday, November 16, 2014 11:15:44 AM UTC-5, MangusB rother wrote:
>>
>> I would like to setup multiple websites on my vps. For that I would like
>> for example to setup gitlab to run under
>>
>> 127.0.0.1/gitlab
>>
>> rather than 127.0.0.1
>>
>> Is there a way how I can do this? Or is there a better alternative?
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "GitLab" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/gitlabhq/fcad0f4f-f8ca-4c52-8c3f-b6a22b999d81%40googlegroups.com
> <https://groups.google.com/d/msgid/gitlabhq/fcad0f4f-f8ca-4c52-8c3f-b6a22b999d81%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"GitLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/gitlabhq/CAPiUgVeFALxxQaHPdp8Tg5KJcmvUcP1wb%2Bu-3KSYUj7RHn9f8Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to