雨が続いてますね。何で雨上がりって臭いんですかね。
さて、ちょっとしたあれでGitLabをCentOSにインストールしてみました。
で、その時ちょっと躓いた所があったのでメモしておきます。
CentOSのバージョン
CentOS release 6.3 (Final)
- apacheとか入っていない状態
作業手順
https://about.gitlab.com/downloads/
の、CentOS 6 (and RedHat/Oracle/Scientific Linux 6)を参考に以下を実行
$ 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 bashGitLabのインストールは簡単になったと、インターネッツの皆が言う通りここまでは本当にスラスラといきました。
エラー発生
で、問題は次
$ sudo yum install gitlab-ceこれをッターンしたら、
〜 中略 〜
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のアップデート
というわけで、早速確認。
# 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ふむふむ。予想通り。
# yum update rpmッターン。
〜 中略 〜
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でしょ。
再挑戦
$ sudo yum install gitlab-ce
〜 中略
Installed:
gitlab-ce.x86_64 0:7.12.0~omnibus.1-1
Complete!Yes!! イェス!!
あとは、設定ファイル /etc/gitlab/gitlab.rb の修正をインターネッツの皆さんに聞きながら設定して、
$ sudo gitlab-ctl reconfigureこれで無事動き出しました。
その他注意点
gitユーザーが既にいる場合
最後の
$ sudo gitlab-ctl reconfigureをする前の注意点は
**gitユーザーを作っていてgitユーザーでログインしている場合、他のユーザーでログインして作業をする
**
です。自分はこれでエラー(Chefのレシピかな)になりました。
(そして、多分いままでやっていたgitユーザー関連の設定をやり直すことになります)
GitLabにアクセス出来ない場合
- プロキシの確認
- hostsの確認
をする。
それでもダメだったら以下を疑ってください。
iptables(port)
- http(80)を開ける
- ※https使うなら443
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で出来て便利っぽいですよ。
もし良かったらチャレンジしてみてください。