If you want the latest bleeding edge version, you can change 7.4 to master in this recipe.
We have just installed GitLab on our server. We have done this by downloading the source code from gitlab.com and performing the preceding steps.
Let's take a look at what we did in every step.
In step 1, we downloaded the source code for GitLab. We haven't done anything with it yet, just downloaded it.
In step 2, we done the basic configuration of GitLab. We have changed the hostname to the fully-qualified domain name you want to access your GitLab on, for example, gitlab.example.com
. Also, we have configured the e-mail addresses that GitLab will send mails from. The email_from
will be used as the from address of all the e-mails that are sent via GitLab.
Next was the setup for the satellite directory. Satellites are used when you create a merge request, and GitLab has to check whether it is mergeable, and perform the actual merge. A satellite is just checking out of the repository that GitLab has access to.
We then went on to copy some files. The first file was the Unicorn configuration file. Unicorn was used as the application server and we copied the Rack Attack files. Rack Attack is used in order to prevent abusive requests to your GitLab server. One way to make sure that no harmful requests make it to your server is by request throttling. This means that we only allow 10 requests per 60 seconds to certain URLs.
The next important step is the configuration of the database. As we are using PostgreSQL on the same machine, the configuration is really straightforward: just copy the right database.yml
file and we are done, well almost; we also need to protect our database.yml
file so that it's only readable for the Git user.
The dependency installation is done via Bundler. Bundler is the package manager for Ruby. We have passed the flags --deployment
and --without development test mysql aws
. The first flag is passed to make sure that the dependencies are installed in the context of GitLab and not in a system-wide context. The second flag is passed to make sure that only the necessary dependencies are installed. If you want to learn more about Bundler, take a look at www.bundler.io.
GitLab has its own Git wrapper to perform Git commands on the server. This wrapper is called GitLab Shell. In step 11, we tell GitLab to fetch the code for GitLab Shell and install it.
In step 12, we set up the database. We create the database and load the database schema. We also create the first user, so that you can log in to your server.