LoginSignup
2
0

More than 5 years have passed since last update.

【Shibboleth V2】IdPサーバのインストール(2) やるっきゃない! IdPのインストール完了まで

Last updated at Posted at 2018-02-10

今夜の一言

続きです。仕事は何とか落ち着いたって感じですが、この生活習慣を何とかしたい!
今日は休みだったのですが、土日は朝倒れてたりするんで結局この時間です(笑)

§4 IdPのインストール

§4-1 Version2のIdPパッケージ取得

SPはバージョン2.6以降はyumからの導入が可能なのですが、IdPはダウンロードしてくるしかありません。以下のサイトからダウンロードできます。

Shibbolethの旧バージョン保存先URL
https://shibboleth.net/downloads/identity-provider/

§4-2 インストール用のシェルスクリプト実行

yumでも入れられちゃうわけですから、そんなに難しいことはないです。
※ただし、人によっては躓くことのない地味なハマりポイントもあるのでご注意を

まずはダウンロードしてきたファイルを解凍します。

ファイルの解凍例
(1) cd ファイルの保存先
(2) tar -zxvf ./shibboleth-identityprovider-2.4.5-bin.tar.gz

ファイルを解凍すると以下のファイルが出てきます。

フォルダの中身
# ll /root/work/shibboleth-identityprovider-2.4.5
合計 44
-rw-r--r--. 1 root wheel 11357  2月  4 08:36 2016 LICENSE.txt
-rw-r--r--. 1 root wheel   458  2月  4 08:36 2016 cpappend.bat
drwxr-xr-x. 2 root root   4096  2月  4 08:36 2016 doc
-rwxr-xr-x. 1 root wheel   896  2月  4 08:36 2016 install.bat
-rwxr-xr-x. 1 root wheel  2513  2月  4 08:36 2016 install.sh
drwxr-xr-x. 2 root root   4096 12月 11 22:20 2017 lib
drwxr-xr-x. 5 root root   4096 12月 11 22:19 2017 src

フォルダに含まれているinstall.shを使います。
rootで作業をしていることを前提として書いていますので、
実行権のないユーザーで作業をする場合はsudoでお願いします。
実行すると対話型のスクリプトが起動します。

スクリプトの実行
./install.sh

実行すると以下のようなメッセージが出てきます。

スクリプトで聞かれる内容
Buildfile: src/installer/resources/build.xml

install:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Be sure you have read the installation/upgrade instructions on the Shibboleth website before proceeding.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Where should the Shibboleth Identity Provider software be installed? [/opt/shibboleth-idp]
[Enter] ←何も入力しない
What is the fully qualified hostname of the Shibboleth Identity Provider server? [idp.example.org]
<<ホスト名(FQDN)>>[Enter] ←サーバで登録しているFQDNを入力します(※)
A keystore is about to be generated for you. Please enter a password that will be used to protect it.
keystore[Enter] ←任意のパスワードを入力
Updating property file: /root/work/shibboleth-identityprovider-2.4.5/src/installer/resources/install.properties
(省略)
BUILD SUCCESSFUL
Total time: xx seconds

上記のようにBUILD SUCCESSFULと表示されるとインストール完了です。

はい、ここで要注意なのはホスト名のところです。
何が注意なのかというと/etc/sysconfig/networkで登録しているホスト名でもエラーになります。
登録されている名前の形式をチェックされているようです。
正しく、FQDNの形式となっていない場合は入力した後、フォルダ作成中にエラーが発生します。以下のような感じです。

エラー内容
Updating property file: /root/work/shibboleth-identityprovider-2.4.5/src/installer/resources/install.properties
Created dir: /opt/shibboleth-idp
Created dir: /opt/shibboleth-idp/bin
Created dir: /opt/shibboleth-idp/conf
Created dir: /opt/shibboleth-idp/credentials
Created dir: /opt/shibboleth-idp/lib
Created dir: /opt/shibboleth-idp/logs
Created dir: /opt/shibboleth-idp/metadata
Created dir: /opt/shibboleth-idp/war

BUILD FAILED
/root/work/shibboleth-identityprovider-2.4.5/src/installer/resources/build.xml:69: java.lang.IllegalStateException: No match found

エラーの内容から原因切り分けていこうとするとヤバいんですよね。
ということでちゃんと手順を見直していって、怪しそうなところがホスト名の部分だったわけです。
エラーが発生した際、スクリプトに対して回答したホスト名は本当に単なるホスト名を回答しました。しかし、これがShibboleth先生のご機嫌を損ねたようです。
皆さんはこんなアホな間違いされないと分かっていて書いておきますが、
ホスト名とFQDNは違います。
違いは以下のページが分かりやすいので参考に記載しておきます。

【参考記事】
ドメイン名・ホスト名・FQDNの違い
http://www.geolocation.co.jp/learn/dns/01.html

上記のページには色々と書いてくれていますが、ここで重要なのは以下です。

ネットワーク上のコンピュータにつける識別用の文字列が「ホスト名」
ホスト名とドメイン名を省略せずにつなげて記述した文字列が「FQDN」

私がエラーを引き起こしたホスト名は「shibboleth-test01」でした。
これを「idp.shibboleth-test01.org」に変更したところ、
エラーが解消してインストールが完了しました。

人によっては気づくことさえないエラーですが、私は躓いたおかげで勉強になりました(笑)

§4-3 warファイルの配置

warファイルをCATALINA_BASE配下のwebappsフォルダ配下に配置します。

warファイル配置コマンド
cp /opt/shibboleth-idp/war/idp.war ${CATALINA_BASE}/webapps/

warファイルとはJava製のWebアプリケーションで使用するservletや設定ファイル、JAR形式のライブラリがまとめられているアーカイブファイルです。
Shibbolethが利用しているTomcatはJavaで動いているのでこの作業が必要になります。

§4-4 サービスの起動

あとはApache、Tomcatを起動してやれば、完了です。

Apache、Tomcatの起動
# service httpd start
# service tomcat6 start

一応ここまででIdPのインストールが完了しました。
次回はいよいよ本丸のSPインストール方法について記載していきます。

2
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
2
0