Recently, I had the problem of moving my GitLab installation from one URL to another. I guess the problem will hit many people every once in a while. On StackOverflow, someone posted half of the answer.
Make a backup and stop GitLab first! Then:
In your application.rb file:
config.relative_url_root = "/gitlab"
In your gitlab.yml file:
In your unicorn.rb:
ENV["RAILS_RELATIVE_URL_ROOT"] = "/gitlab"
You also need to re-configure your web server appripriately.
Now... that does part of the job, but after doing it, I could not properly reach nor use my GitLab site. The two remaining issues are (a) adjusting the URLs in the database, and (b) updating the assets cache. Here are the remaining bits, assuming that you are on MySQL (adapt for other database engines, accordingly):
mysql> update events set data = replace(data, "http://22.214.171.124/", "http://126.96.36.199/gitlab/");
Next, as the appropriate user, do this:
$ rake gitlab:satellites:create RAILS_ENV=production $ rake assets:clean RAILS_ENV=production $ rake assets:precompile RAILS_ENV=production
Then restart GitLab.
If you omit the recompiling of the assets, that will yield you broken icons, or, if you simply deleted them, a lot of 502s, until Rails was able to compile them.
At this point, you have access to your projects using the web, but SSH
access does not yet work. You will see "Access denied" message. To fix
that, you have to
gitlab-shell configuration. Then
put this in your
This URL must reflect the new URL you have chosen. After that,
<rikurrr> for the idea of directly looking into the