LoginSignup
3
0

More than 5 years have passed since last update.

CentOS7にGitLab8を構築

Last updated at Posted at 2016-09-24

[概要]

GitLabをプライベートの環境に欲しかったので勉強がてら構築する。

インストールは公式のドキュメントがあるので参考にすると良い。
https://about.gitlab.com/downloads/#centos7

[事前準備]

CentOS7をインストールしてあること。

[作業内容]

依存関係のパッケージをインストール

$ sudo yum install curl
$ sudo yum install policycoreutils
$ sudo yum install openssh-server
$ sudo yum install openssh-server
$ sudo yum install openssh-clients
$ sudo yum install postfix

postfix起動

$ sudo systemctl start postfix
$ sudo systemctl enable postfix

GitLabのインストール

GitLabのリポジトリを追加

$ curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

GitLabのパッケージ追加

$ sudo yum install gitlab-ce

GitLabの設定反映と起動

$ sudo gitlab-ctl reconfigure

GitLabの設定ファイルについて

GitLabの設定ファイルは /etc/gitlab/gitlab.rb となっている。
GitLabの構成は、Nginx、PostgreSQL、Redis、Unicorn等のミドルウェアから構成されており、この設定ファイルをもとに、サーバー構成ツールの Chef が、各種ミドルウェアの設定を行う、といった流れになっている。
そのため、GitLabの設定を変更したら gitlab-ctl reconfigure を実行して、設定を反映するといった運用になる。

GitLabの設定ファイル確認

$ sudo vi /etc/gitlab/gitlab.rb

下記のURLが、正しく設定されているか確認
正しくなかった場合は、設定ファイルを編集し、sudo gitlab-ctl reconfigure を実行

/etc/gitlab/gitlab.rb
external_url 'http://{ドメイン}'

GitLabへアクセス

サーバのIP・ドメイン等をURLに打ち込みアクセスする。
初期ユーザ情報

ユーザ名 root
パスワード 5iveL!fe

ログインするとパスワードの変更が求められるので変更する。
変更後は、ログイン画面に飛ばされるので、変更したユーザ情報でログインする。

[事後確認・作業]

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0