LoginSignup
10
15

More than 5 years have passed since last update.

CentOS7.4にGitLab CE 10.7.3の環境を構築する

Posted at

CentOS7.4にGitLab CE 10.7.3の環境を構築する

事前準備

以下の記事手順に従って、事前にCentOS7.4の環境が構築済みであること。
Vagrant2.0.3を使ったCentOS7.4の環境構築

また、ホスト名の設定が下記のようになっていること。
またホスト名で名前解決ができる状態であること。

hostname
gitlab-hostname

GitLabの環境構築

GitLabの環境構築をする各環境情報

ソフトウェア バージョン
1 GitLab CE 10.7.3
2 OS CentOS 7.4

GitLabインストール前の準備

依存関係のモジュールをインストール

sudo yum install -y curl policycoreutils-python openssh-server

sshdを自動起動にしてスタート

sudo systemctl enable sshd
sudo systemctl start sshd

ファイアウォールを自動起動にしてhttpポートを開ける

sudo systemctl enable firewalld
sudo systemctl start firewalld
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld

メース転送ソフトウェアのpostfixをセットアップ

sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix

GitLab CE(Community Edition)のシェルスクリプトダウンロード及びリポジトリのセットアップ

cd /usr/local/src
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

GitLab CEのインストール

EXTERNAL_URLgitlab-hostnameの部分は、任意のホスト名やドメイン名を環境に合わせて変更し、コマンドを実行する。
このEXTERNAL_URLは、GitLabからユーザーがcloneする際、正しいURLを生成するために必要な設定のようです。
参考:https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab

sudo EXTERNAL_URL="http://gitlab-hostname" yum install -y gitlab-ce

GitLabの変更を反映

念のため設定を反映するためにreconfigureを実行します。
GitLabインストール完了時にgitlab Reconfigured!というメッセージが出力されているため、たぶんこの手順はいらないのかもしれませんが。。。

sudo gitlab-ctl reconfigure

GitLabにアクセス確認

以下のURLにアクセスしてGitLabのログイン画面が表示されることを確認。
http://gitlab-hostname

Change your passwordと、管理アカウント``のパスワードを変更するように求められるので、任意のパスワードを入力して変更する。

その後、ログイン画面でroot/変更したパスワードでログインできれば環境構築完了。

その他

GitLab Web IDE

GitLab10.7のバージョンから、CEでWebIDEが一般公開されています。
GitLab上でコードの編集ができる機能のようです。

1.PNG

10
15
3

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
10
15