GitLabをCentOSにインストールして躓いた時のメモ

投稿日:

雨が続いてますね。何で雨上がりって臭いんですかね。

さて、ちょっとしたあれでGitLabをCentOSにインストールしてみました。
で、その時ちょっと躓いた所があったのでメモしておきます。

CentOSのバージョン

  • CentOS release 6.3 (Final)

    • apacheとか入っていない状態

作業手順

https://about.gitlab.com/downloads/
の、CentOS 6 (and RedHat/Oracle/Scientific Linux 6)を参考に以下を実行

1
2
3
4
5
$ sudo yum install curl openssh-server postfix cronie
$ sudo service postfix start
$ sudo chkconfig postfix on
$ sudo lokkit -s http -s ssh
$ curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

GitLabのインストールは簡単になったと、インターネッツの皆が言う通りここまでは本当にスラスラといきました。

エラー発生

で、問題は次

1
$ sudo yum install gitlab-ce

これをッターンしたら、

1
2
3
4
5
6
〜 中略 〜
ERROR You need to update rpm to handle:
rpmlib(TildeInVersions) <= 4.10.0-1 is needed by gitlab-ce-7.12.0~omnibus.1-1.x86_64
RPM needs to be updated
 You could try running: rpm -Va --nofiles --nodigest
Your transaction was saved, rerun it with: yum load-transaction /tmp/yum_save_tx-2015-07-01-10-18pOSfIU.yumtx

こんなエラー。
まじかよ!全然カンタンじゃねー!!みんなの嘘つき!!

でも、

何事も人のせいにしてはいけません。
そう過ごしてきた結果が今のあなたの姿ではないですか?

と、どこからか聞こえた気がして、きちんとエラーメッセージに向き合いました。
っていうか、RPM needs to be updatedじゃね?
めっさ分かりやすいわ。

rpmのアップデート

というわけで、早速確認。

01
02
03
04
05
06
07
08
09
10
11
12
13
14
# yum list rpm
 
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
Could not get metalink https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=x86_64 error was
14: problem making ssl connection
 * base: ftp.iij.ad.jp
 * epel: ftp.kddilabs.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
Installed Packages
rpm.x86_64          4.8.0-27.el6             @anaconda-CentOS-201207061011.x86_64/6.3
Available Packages
rpm.x86_64          4.8.0-38.el6_6           updates

ふむふむ。予想通り。

1
# yum update rpm

ッターン。

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
〜 中略 〜
Running Transaction
  Updating   : rpm-libs-4.8.0-38.el6_6.x86_64                                    1/8
  Updating   : rpm-4.8.0-38.el6_6.x86_64                                         2/8
  Updating   : rpm-build-4.8.0-38.el6_6.x86_64                                   3/8
  Updating   : rpm-python-4.8.0-38.el6_6.x86_64                                  4/8
  Cleanup    : rpm-python-4.8.0-27.el6.x86_64                                    5/8
  Cleanup    : rpm-build-4.8.0-27.el6.x86_64                                     6/8
  Cleanup    : rpm-libs-4.8.0-27.el6.x86_64                                      7/8
  Cleanup    : rpm-4.8.0-27.el6.x86_64                                           8/8
  Verifying  : rpm-4.8.0-38.el6_6.x86_64                                         1/8
  Verifying  : rpm-build-4.8.0-38.el6_6.x86_64                                   2/8
  Verifying  : rpm-libs-4.8.0-38.el6_6.x86_64                                    3/8
  Verifying  : rpm-python-4.8.0-38.el6_6.x86_64                                  4/8
  Verifying  : rpm-python-4.8.0-27.el6.x86_64                                    5/8
  Verifying  : rpm-build-4.8.0-27.el6.x86_64                                     6/8
  Verifying  : rpm-4.8.0-27.el6.x86_64                                           7/8
  Verifying  : rpm-libs-4.8.0-27.el6.x86_64                                      8/8
 
Updated:
  rpm.x86_64 0:4.8.0-38.el6_6
 
Dependency Updated:
  rpm-build.x86_64 0:4.8.0-38.el6_6          rpm-libs.x86_64 0:4.8.0-38.el6_6
  rpm-python.x86_64 0:4.8.0-38.el6_6
 
Complete!

よしこれでOKでしょ。

再挑戦

1
2
3
4
5
6
$ sudo yum install gitlab-ce
〜 中略
Installed:
  gitlab-ce.x86_64 0:7.12.0~omnibus.1-1
 
Complete!

Yes!! イェス!!

あとは、設定ファイル /etc/gitlab/gitlab.rb の修正をインターネッツの皆さんに聞きながら設定して、

1
$ sudo gitlab-ctl reconfigure

これで無事動き出しました。

その他注意点

gitユーザーが既にいる場合

最後の

1
$ sudo gitlab-ctl reconfigure

をする前の注意点は

gitユーザーを作っていてgitユーザーでログインしている場合、他のユーザーでログインして作業をする

です。自分はこれでエラー(Chefのレシピかな)になりました。
(そして、多分いままでやっていたgitユーザー関連の設定をやり直すことになります)

GitLabにアクセス出来ない場合

  • プロキシの確認
  • hostsの確認

をする。
それでもダメだったら以下を疑ってください。

  • iptables(port)

    • http(80)を開ける
    • ※https使うなら443
1
2
3
vim /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
/etc/init.d/iptables restart

※ルートでね

これでもダメだったらググってください。

最後に

上記のように、少し躓いたところはあったものの簡単にGitLabをインストール出来ました。
まだ少ししか触っていないですが、ユーザー管理とかGUIで出来て便利っぽいですよ。
もし良かったらチャレンジしてみてください。

作成者: shimabox

Web系のプログラマをやっています。 なるべく楽しく生きていきたい。

コメントする

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

This site uses Akismet to reduce spam. Learn how your comment data is processed.