GITHUB

1) Install GitLab On Ubuntu 16.04 / 17.10 / 18.04 LTS

GitLab (Git-repository manager), an open source version control platform similar to Gitbub, is robuts, scalable and a great alternative to Github. GitLab has rich features like issues and time tracking, repository branching, file locking and tagging, merging and many others features that you will find in a typical source control platform..

GitLab streamlines your collaborative workflows. Visualize, prioritize, coordinate, and track your progress your way with GitLab’s flexible project management tools.

This brief tutorial is going to show students and new users how to easily install GitLab on Ubuntu 16.04 / 17.10 and 18.04…

To install GitLab on Ubuntu, follow the steps below:

Step 1: Install GitLab Packages

Now that your server is ready, run the commands below to download and install GitLab packages… the EXTERNAL_URL value should be the URL for the GitLab site. If you’re testing in a development environment, you may have to enter that in the server host file. and this is the URL that you’ll need to access the GitLab site.

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
EXTERNAL_URL=”http://192.168.1.11″ sudo apt install gitlab-ce

After the commands above you should see a completion message

Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
sudo gitlab-ctl reconfigure

 

2) Install GitLab On Ubuntu 16.04 / 17.10 / 18.04 LTS
!robot | 06/14/2018 | Applications, Labs, Linux Ubuntu | No Comments
GitLab (Git-repository manager), an open source version control platform similar to Gitbub, is robuts, scalable and a great alternative to Github… GitLab has rich features like issues and time tracking, repository branching, file locking and tagging, merging and many others features that you will find in a typical source control platform..

GitLab streamlines your collaborative workflows. Visualize, prioritize, coordinate, and track your progress your way with GitLab’s flexible project management tools.

This brief tutorial is going to show students and new users how to easily install GitLab on Ubuntu 16.04 / 17.10 and 18.04…

To install GitLab on Ubuntu, follow the steps below

Step 1: Install Required Packages
Before installing GitLab, you must make sure Ubuntu is ready… that means, installing necessary packages in order for GitLab to function… To do that, run the commands below..

sudo apt update
sudo apt install curl openssh-server ca-certificates
Next, run the commands below to install Postfix MTA for notifications…

sudo apt install postfix

During the installation, you’ll be prompted to select the type of mail configuration… make sure to choose Internet Site [ Mail is sent and received directly using SMTP] as shown below… then press Enter to continue..

GitLab Ubuntu Install
Next, provide a mail server name… then can be the server Postfix is installed on…

mail.example.com

GitLab Ubuntu install
Step 2: Install GitLab Packages
Now that your server is ready, run the commands below to download and install GitLab packages… the EXTERNAL_URL value should be the URL for the GitLab site… If you’re testing in a development environment, you may have to enter that in the server host file….. and this is the URL that you’ll need to access the GitLab site…

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
EXTERNAL_URL=”http://gitlab.example.com” sudo apt install gitlab-ce
After the commands above you should see a completion message…

Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
sudo gitlab-ctl reconfigure

Run the commands below to start GitLab instance.
sudo gitlab-ctl reconfigure

By default, Ubuntu firewall is disabled… if you enabled, it then run the commands below to allow HTTP and HTTPS traffic

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

After that, open your browser and browse to the URL for your GitLab instance.

That’s it! This is how to get GitLab installed on Ubuntu systems… more advanced settings can come after, but this is the bare minimal to get GitLab started..

Default username is root

Install GitLab on Ubuntu 16.04 / 17.10 / 18.04 LTS

Using a non-bundled web-server

By default, omnibus-gitlab installs GitLab with bundled Nginx. Omnibus-gitlab allows webserver access through user gitlab-www which resides in the group with the same name. To allow an external webserver access to GitLab, external webserver user needs to be added gitlab-www group.

To use another web server like Apache or an existing Nginx installation you will have to perform the following steps:

Disable bundled Nginx

In /etc/gitlab/gitlab.rb set:

nginx[‘enable’] = false

Set the username of the non-bundled web-server user

By default, omnibus-gitlab has no default setting for the external webserver user, you have to specify it in the configuration. For Debian/Ubuntu the default user is www-data for both Apache/Nginx whereas for RHEL/CentOS the Nginx user is nginx.

Note: Make sure you have first installed Apache/Nginx so the webserver user is created, otherwise omnibus will fail while reconfiguring.

Let’s say for example that the webserver user is www-data. In /etc/gitlab/gitlab.rb set:

web_server[‘external_users’] = [‘www-data’]

Note: This setting is an array so you can specify more than one user to be added to gitlab-www group.

Run sudo gitlab-ctl reconfigure for the change to take effect.

Note: if you are using SELinux and your web server runs under a restricted SELinux profile you may have to loosen the restrictions on your web server.

*Note: make sure that the webserver user has the correct permissions on all directories used by external web-server, otherwise you will receive failed (XX: Permission denied) while reading upstream errors.

1. /etc/apache2/sites-available/gitlab.conf

#This configuration has been tested on GitLab 6.0.0 and GitLab 6.0.1
#Note this config assumes unicorn is listening on default port 8080.
#Module dependencies
# mod_rewrite
# mod_proxy
# mod_proxy_http
<VirtualHost *:81>
ServerName mysite.example.com # I have also tried gitlab.mysite.example.com
ServerSignature Off

ProxyPreserveHost On

# Ensure that encoded slashes are not decoded but left in their encoded state.
# http://doc.gitlab.com/ce/api/projects.html#get-single-project
AllowEncodedSlashes NoDecode

<Location />
# New authorization commands for apache 2.4 and up
# http://httpd.apache.org/docs/2.4/upgrading.html#access
Require all granted

ProxyPassReverse http://127.0.0.1:8081
ProxyPassReverse http://mysite.example.com:81/ # I have also tried http://gitlab.mysite.example.com:81/ and have also tried dropping the trailing slash
</Location>

#apache equivalent of nginx try files
# http://serverfault.com/questions/290784/what-is-apaches-equivalent-of-nginxs-try-files
# http://stackoverflow.com/questions/10954516/apache2-proxypass-for-rails-app-gitlab
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule .* http://127.0.0.1:8081%{REQUEST_URI} [P,QSA]

# needed for downloading attachments
DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public

#Set up apache error documents, if back end goes down (i.e. 503 error) then a maintenance/deploy page is thrown up.
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_error.log
CustomLog /var/log/apache2/gitlab_forwarded.log common_forwarded
CustomLog /var/log/apache2/gitlab_access.log combined env=!dontlog
CustomLog /var/log/apache2/gitlab.log combined

</VirtualHost>
/etc/apache2/ports.conf

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 80
Listen 81
<IfModule ssl_module>
Listen 443
</IfModule>

<IfModule mod_gnutls.c>
Listen 443
</IfModule>

Enable site in Apache2:

sudo a2ensite example1.conf

For disable: sudo a2dissite example1.conf

Then restart apache2:

sudo systemctl restart apache2

Leave a Reply

Your email address will not be published. Required fields are marked *