比較バージョン

キー

  • この行は追加されました。
  • この行は削除されました。
  • 書式設定が変更されました。

...

"root"ユーザではなく、Jetty起動用のユーザを使用することを推奨します。
ここでは、一般的な "jetty" ユーザを作成します。(以降、"jetty"ユーザを使用する事が前提で説明します。)ユーザを使用する事を前提として説明します。)

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

# groupadd -g 110 jetty
# useradd -u 110 -r g jetty -d /opt/jetty-base -s /sbin/nologin -c "Jetty daemon" jetty
useradd: 警告: ホームディレクトリが既に存在します。
skel ディレクトリからのコピーは行いません。

もしくは、
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.

(上の手順でディレクトリ作成済みのため警告が出ますが問題ありません)
以下のコマンドでその他 Jetty 関連の設定ファイルやディレクトリの所有者、パーミッションを設定します。

...

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

# cp -ip /opt/jetty/bin/jetty.sh /etc/init.d/jetty
# cp -ip /opt/jetty/bin/jetty.service /etc/systemd/system/

jetty.serviceについては、コピー後に以下のように修正します。serviceについては、コピー後に以下のように[Service]部分を修正します。

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

[Service]
Type=forking
EnvironmentFile=-/etc/sysconfig/jetty
PIDFile=/opt/jetty-base/tmp/jetty.pid
ExecStart=/etc/init.d/jetty start
ExecStop=/etc/init.d/jetty stop
ExecReload=/etc/init.d/jetty restart
SuccessExitStatus=143
User=jetty
Group=jetty
TimeoutStartSec=150

以下を実行して、修正した内容を反映させます。

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

# systemctl daemon-reload

...

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

JAVA=/usr/lib/jvm/jre/bin/java
JETTY_HOME=/opt/jetty
JETTY_BASE=/opt/jetty-base
JETTY_RUN=/opt/jetty-base/tmp
JETTY_STATE=/opt/jetty-base/tmp/jetty.state
JETTY_START_TIMEOUT=120


2. 自動起動の設定

以下のコマンドで自動起動設定を有効にします。

...

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

# Any other required Jetty modules...

# Allows setting Java system properties (-Dname=value)
# and JVM flags (-X, -XX) in this file
# NOTE: spawns child Java process
--exec

# Uncomment if IdP is installed somewhere other than /opt/shibboleth-idp
#-Didp.home=/path/to/shibboleth-idp

# Newer garbage collector that reduces memory needed for larger metadata files
-XX:+UseG1GC

# Maximum amount of memory that Jetty may use, at least 1.5G is recommended
# for handling larger (> 25M) metadata files but you will need to test on
# your particular metadata configuration
-Xmx1500m

# Prevent blocking for entropy.
-Djava.security.egd=file:/dev/./urandom

# Set Java tmp location
-Djava.io.tmpdir=tmp

/opt/jetty-base/start.d/idp.ini の修正

...

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN"
"http://www.eclipse.org/jetty/configure_9_4.dtd">
<Configure id="sslContextFactoryshibContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory">
<Set name="IncludeProtocols">
<Array type="String">
<Item>TLSv1.3</Item>
<Item>TLSv1.2</Item>
</Array>
</Set>
<Set name="ExcludeProtocols">
<Array type="String">
<Item>TLSv1.1</Item>
<Item>TLSv1</Item>
<Item>SSL</Item>
<Item>SSLv2</Item>
<Item>SSLv3</Item>
</Array>
</Set>
<Set name="IncludeCipherSuites">
<Array type="String">
<Item>TLS_ECDHE.*</Item>
<Item>TLS_AES.*</Item>
<Item>TLS_RSA.*</Item>
</Array>
</Set>
<Set name="ExcludeCipherSuites">
<Array type="String">
<Item>.*NULL.*</Item>
<Item>.*RC4.*</Item>
<Item>.*MD5.*</Item>
<Item>.*DES.*</Item>
<Item>.*DSS.*</Item>
<Item>TLS_DHE.*</Item>
</Array>
</Set>
</Configure>

上記ファイルを参照するように /opt/jetty-base/modules/idp-backchannel.mod に追記します。

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

(省略)

[xml]
etc/idp-backchannel.xml
etc/tweak-ssl.xml


4. httpd の設定

以下のように設定ファイルの修正を行います。

...

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

(省略)
<VirtualHost _default_:443>

(省略)
#ServerName ex-idp-test??.gakunin.nii.ac.jp:443 ← ??は各自割り振られた番号(0番なら「00」
↑コメントアウト(#)を削除
↓以下を追加
RequestHeader set X-Forwarded-Port 443
RequestHeader set X-Forwarded-Proto https

RequestHeader unset Forwarded
RequestHeader unset X-Forwarded-For
ProxyPass /idp/ http://localhost:8080/idp/ connectiontimeout=5 timeout=15

RequestHeader set REMOTE-USER %{REMOTE_USER}s

(省略)

/etc/httpd/conf.d/virtualhost-localhost80.conf の作成

...

4. Shibbolethのインストール 

各ファイル名等の指定は,Version 4.02.1に準拠しています。

1.   インストール

Shibboleth IdPのパッケージは、「/root/PKG」配下にあります。

...

注意

インストール時に入力するパスワードを本運用で使う場合は、推測されにくいものを使用してください。
※ここで入力したパスワードは、/opt/shibboleth-idp/credentials/secrets.propertiesに記載されます。(平文)(cookiepassのほう)
※backpassのほうは記載されません。/opt/shibboleth-idp/confcredentials/idp.propertiesに記載されます。(平文)-backchannel.p12の暗号化のために使用されます。(本技術ガイドではidp-backchannel.p12を使用しません)

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

Buildfile: /root/PKG/shibboleth-identity-provider-4.02.1/bin/build.xml

install:
Source (Distribution) Directory (press <enter> to accept default): [/root/PKG/shibboleth-identity-provider-4.03.1] ?
[Enter] ←入力なし

Installation Directory: [/opt/shibboleth-idp] ?
[Enter] ←入力なし
INFO [net.shibboleth.idp.installer.V4Install:151] - New Install. Version: 4.03.1
Hostname: [ip-??-?-?-???.ap-northeast-1.compute.internal]

ex-idp-test??.gakunin.nii.ac.jp]
[Enter] 入力なし ※表示されたホスト名が違う場合、設定してください。??は各自割り振られた番号(0番なら「00」
 (省略)
Backchannel PKCS12 Password: backpass[Enter] ←任意のパスワード←任意のパスワード(不使用)

Re-enter password: backpass[Enter]

 (省略)
Cookie Encryption Key Password: cookiepass[Enter] ←任意のパスワード←任意のパスワード(内部で使用)
Re-enter password: cookiepass[Enter]
 (省略)
SAML EntityID: [https://
ex-idp-test??.gakunin.nii.ac.jp/idp/shibboleth] ?
[Enter] ←入力なし
Attribute Scope: [
gakunin.nii.ac.jp]
nii.ac.jp [Enter] nii.ac.jpを設定してください。

 (省略)

BUILD SUCCESSFUL
Total time: 2 minutes 9 seconds

 (省略)

 上記のような質問に答えながら、インストールを行います。

...

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

# /opt/shibboleth-idp/bin/build.sh

 build.shシェルスクリプトを実行すると、以下のような問い合わせがあります。
手順に従って、進めてください。

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

Buildfile: /opt/shibboleth-idp/bin/build.xml

build-war:
Installation Directory: [/opt/shibboleth-idp] ?
[Enter] ←入力なし

Rebuilding /opt/shibboleth-idp/war/idp.war, Version 4.3.1
Initial populate from /opt/shibboleth-idp/dist/webapp to /opt/shibboleth-idp/webpapp.tmp
Overlay from /opt/shibboleth-idp/edit-webapp to /opt/shibboleth-idp/webpapp.tmp
Creating war file /opt/shibboleth-idp/war/idp.war


BUILD SUCCESSFUL

(省略)


httpdの再起動とJettyの起動を行います。(すでにJettyが起動している場合はstopしてから行ってください)

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid
# systemctl restart httpd
# systemctl start jetty
注意

Jettyに関する注意事項※jetty起動に失敗したら設定修正後、

  • jetty起動に失敗したら設定修正後、/opt/jetty-base/tmp/下にファイルが残っていたら削除してから再度起動してください。
※build
  • build.shしたら sudo systemctl restart jetty しないと反映されません。


...

アンカー
idpInst5
idpInst5

5. サービスの起動・停止方法

...