Can't get Gitlab setup right on Ubuntu14.4 / Apache 2.4


#1

First of all: great product guys, I really enjoy working with GitLab and would like to continue to do so.
Second: i’ve read [SOLVED] Setting up Gitlab on Ubuntu 14.04 with Apache2 without owning a domain name as well and it doesn’t help me.

I will try to be as consise as i can: I have scoured the internet for a fix for my problem, but none of it seems to work, which leads me to believe I’m missing something completely obvious so my apologies in advance for being an idiot.

Situation:
OS: Ubuntu 14.04
Webserver: Apache2.4
Ruby 2.2.3
Other installed stuff: PHP5, MySQL and nothing else.

I installed the gitlab onmibus version again yesterday and am trying to get it to run on apache by editing gitlab.rb:

external_url 'http://gitlab.[mywebsite].net' gitlab_workhorse['listen_network'] = "tcp" gitlab_workhorse['listen_addr'] = "127.0.0.1:8181" web_server['external_users'] = ['www-data'] ngins['enable'] = false
Note that [mywebsite].net and www.[mywebsite].net are working and running on apache and are reachable.
I then proceeded to create a new virtual host and setting it up based on the recipe on the gitlab documentation site:
<VirtualHost *:80> ServerName gitlab.[mywebsite].net ServerAlias gitlab ServerSignature Off ProxyPreserveHost On AllowEncodedSlashes NoDecode <Location /> Require all granted ProxyPassReverse http://127.0.0.1:8181 ProxyPassReverse http://gitlab.[mywebsite].net/ </Location> RewriteEngine on RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA,NE] DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public ErrorDocument 404 /404.html ErrorDocument 422 /422.html ErrorDocument 500 /500.html ErrorDocument 503 /deploy.html LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common_forwarded ErrorLog /var/log/apache2/gitlab.[mywebsite].net_error.log CustomLog /var/log/apache2/gitlab.[mywebsite].net_forwarded.log common_forwarded CustomLog /var/log/apache2/gitlab.[mywebsite].net_access.log combined env=!dontlog CustomLog /var/log/apache2/gitlab.[mywebsite].net.log combined </VirtualHost>

I enabled the site in apache as well as the mods “rewrite” “proxy” and “http_proxy” and start Apache.
No errors, no problems, nothing problematic logged, but i am not able to acces Gitlab on my server.

netstat -ltnp | grep “:8” returns
tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN 1705/config.ru tcp 0 0 127.0.0.1:8181 0.0.0.0:* LISTEN 1641/gitlab-workhor tcp6 0 0 :::80 :::* LISTEN 3045/apache2

So everything seems in place. When I attempt to go to
http://gitlab.[mywebsite].net/ chrome returns:
ERR_NAME_NOT_RESOLVED
http://[mywebsite].net:8080 or http://[mywebsite].net:8181/ chrome returns:
ERR_CONNECTION_REFUSED

But in my shell curl -i localhost:8080 and curl -i localhost:8181 return
HTTP/1.1 302 Found Date: Wed, 03 Feb 2016 11:30:07 GMT Status: 302 Found Connection: close X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff Location: http://localhost:8080/users/sign_in Content-Type: text/html; charset=utf-8 Cache-Control: no-cache Set-Cookie: _gitlab_session=52fe763af32749e7d10a65cb6d245664; path=/; expires=Wed, 10 Feb 2016 11:30:07 -0000; HttpOnly X-Request-Id: 28caec80-848a-4b04-bb1a-f49e07d346a8 X-Runtime: 0.304589 You are being <a href="http://localhost:8080/users/sign_in">redirected

Which seems to try to forward me to the login page…

I am not the sharpest tool in the shed when it comes to DNS and hosts files etc. so i will mention that i have not touched anything there.

I hope someone can help me here!! Many thanks in advance.