Please, I need to set the Github with Apache on Ubuntu Server 4.14 I want to set up my localhost to the / var / www Apache, done that actually. But when I install Gitlab I lose this setting, when you type localhost it falls on the page of Gitlab and I need it from falling in the / var / www Could anyone help me?
Assuming that you already have installed gitlab, try this:
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 set to be listening on port 8080 and be set for your correct url.
Now Apache needs to proxy traffic for requests from that url to gitlab.
Enable the Apache Proxy module.
sudo a2enmod proxy_http
Now create a file for the virtual host, we will call this one gitlab.conf.
sudo vi /etc/apache2/sites-available/gitlab.conf
This is your config 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
Enable the host and test Apache configuration.
sudo a2ensite gitlab.conf
sudo apachectl configtest
Did that last test throw an error?
You may want to check your Apache configs prior to reloading or restarting Apache.
Otherwise you can run the below command, and visit the url you setup
sudo service apache2 reload
Source: http://jasonrichardsmith.org/blog/gitlab-apache-ubuntu
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With