Assuming you have already installed gitlab, try the following:
sudo sh -c "echo 'external_url \"http://localhost:8080\"' > /etc/gitlab/gitlab.rb" sudo gitlab-ctl reconfigure sudo gitlab-ctl restart
So, now gitlab should be running and configured to listen on port 8080 and should be installed for your correct URL.
Now Apache needs proxy traffic for requests from this URL in gitlab.
Enable the Apache proxy module.
sudo a2enmod proxy_http
Now create a file for the virtual host, let's call it gitlab.conf.
sudo vi /etc/apache2/sites-available/gitlab.conf
This is your configuration file.
<VirtualHost *:80> ServerName gitlab.localhost #git lab passthrough ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ </VirtualHost>
And in your hosts file add this line:
127.0.0.0 gitlab.localhost
Turn on the host and check your Apache configuration.
sudo a2ensite gitlab.conf sudo apachectl configtest
Did this last test fail?
You can check your Apache configurations before rebooting or restarting Apache.
Otherwise, you can run the command below and visit the URL that you set
sudo service apache2 reload
Source: http://jasonrichardsmith.org/blog/gitlab-apache-ubuntu