0

I installed gitlab on my Debian Wheezy server a few days ago and I managed to get it working with:

  • Apache
  • Relative URL (/gitlab)
  • HTTPS

I installed it from source following the official installation guide.

I just upgraded to Debian Jessie and after some changes to my apache conf files, I managed to get gitlab almost working...

I can go to domain.com/gitlab: I get redirected domain.com/gitlab/users/sign_in.

But when I am logged in, I cannot access domain.com/gitlab! I can access everything (at least I think), such as:

/gitlab/dashboard/
/gitlab/<username>/<project-name>
/gitlab/admin

And so on... But not domain.com/gitlab...

My log/production.log when I try to access /gitlab:

Started GET "/gitlab/index.html" for 140.93.2.243 at 2016-01-26 08:15:56 +0100
Processing by NamespacesController#show as HTML
  Parameters: {"id"=>"index.html"}
Completed 404 Not Found in 28ms (Views: 0.8ms | ActiveRecord: 2.7ms)

What I tried:

# Checking the installation: Everything looked ok.
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production

# Reinstalling gitlab-shell (and updating the config for https)
sudo -u git -H bundle exec rake gitlab:shell:install 
    REDIS_URL=unix:/var/run/redis/redis.sock RAILS_ENV=production

# (Re)-setting up my DB
sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production

# (Re)-compiling assets
sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production

Feel free to ask for more details, I don't know what may or may not be relevant here.

Holt
  • 181
  • 2
  • 8

1 Answers1

0

I managed to get it working by installing the passenger module:

sudo apt-get install libapache2-mod-passenger

And in my conf file, enabling the following two lines:

RailsEnv production
PassengerAppRoot /home/git/gitlab

Details:

In Apache 2.2 I used the following:

Alias /gitlab "/home/git/gitlab/public/"
<Directory "/home/git/gitlab/public">

    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all

#    RailsEnv production
#    SetEnv RAILS_RELATIVE_URL_ROOT "/gitlab"
#    PassengerAppRoot /home/git/gitlab

    ProxyPassReverse http://127.0.0.1:8181
    ProxyPassReverse http://127.0.0.1:8080
    ProxyPassReverse http://YOUR_SERVER_FQDN/

    # Redirect directives from original gitlab-ssl-apache22.conf
</Directory>

I am not even sure that the proxy directives were doing something but it was working.

In Apache 2.4, Proxy directives are not allowed in Directory, so I use the following:

Alias /gitlab "/home/git/gitlab/public/"
<Directory "/home/git/gitlab/public">

    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Options -MultiViews
    Require all granted

    RailsEnv production
    PassengerAppRoot /home/git/gitlab

    # Same Redirect directives
</Directory>
Holt
  • 181
  • 2
  • 8