官术网_书友最值得收藏!

Using the Omnibus package

The people from GitLab have created an Omnibus package for the major Linux distributions (Ubuntu, Debian, and CentOS). These packages are an easy way of installing your GitLab installation, as they have all the dependencies packaged with them.

For this recipe, we are going to use the Ubuntu version of the Omnibus package.

Getting ready

Before we start installing, you need to have a server installed with a Ubuntu 12.04 64-bit system, and have SSH access to the server.

How to do it…

Here is how you can install GitLab using Omnibus:

  1. Download the package, change the X.Y.Z portion to the version you want to download. At the time of writing, 7.3.2 is the latest version:
    wget https://downloads-packages.s3.amazonaws.com/ubuntu-12.04/gitlab_X.Y.Z-omnibus.5.1.0.ci-1_amd64.deb
    
  2. Install the OpenSSH server:
    sudo apt-get install openssh-server
    
  3. Install Postfix:
    sudo apt-get install postfix
    
  4. Postfix will ask you what kind of installation you want; choose the Internet Site option.
  5. Enter the fully qualified domain name for the domain you want GitLab to send e-mails from (that is, gitlab.example.com).
  6. Install the Omnibus package, and replace the X.Y.Z part with your version:
    sudo dpkg -i gitlab_7.3.2-omnibus.5.1.0.ci-1_amd64.deb
    
  7. Now, we will configure your GitLab instance by running the following command:
    sudo gitlab-ctl reconfigure
    
  8. Check to see whether all the services are running using the following command:
    sudo gitlab-ctl status
    

    The output should look like the following screenshot:

You can now log in with the username root and password 5iveL!fe.

How it works…

We have just installed GitLab via the Omnibus installer. Omnibus is a way to package your application and install all the dependencies that are required to run it.

GitLab makes good use of this capability. As you only have to install a mail server and an OpenSSH server, all the other parts are automatically installed for you.

GitLab will auto configure itself with the recommended settings. If you want to change your configuration, you have to first create the configuration file. You can do this as follows:

$ sudo mkdir -p /etc/gitlab
$ sudo touch /etc/gitlab/gitlab.rb
$ sudo chmod 600 /etc/gitlab/gitlab.rb

The settings that you are most likely to change are the ones that are in the gitlab.yml file (https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/gitlab.yml.example).

You need to make a small translation change in order to make this work, so let's say you want to change the port that GitLab is running on; normally, you would change the port value in the GitLab file, but now you have to add an entry to /etc/gitlab/gitlab.rb.

So, for the port, the entry in gitlab.yml would look like the following code:

production: &base
  gitlab:
    port: 80

In the gitlab.rb file, you need to create the following entry: gitlab_rails['port'] = 80.

主站蜘蛛池模板: 武功县| 若尔盖县| 杭锦后旗| 镇安县| 关岭| 门源| 文昌市| 会昌县| 通化县| 崇信县| 白银市| 万宁市| 晋州市| 垦利县| 台南市| 固镇县| 潼南县| 怀柔区| 绥化市| 寿宁县| 平远县| 宣威市| 岢岚县| 双辽市| 衡阳县| 黄石市| 田东县| 洛扎县| 察隅县| 文水县| 慈溪市| 阿坝县| 维西| 元阳县| 青河县| 瑞丽市| 水富县| 博爱县| 晋江市| 建平县| 固阳县|