Glassfish 用のポリシーエージェントのインストール手順
このページは実機での検証をもとにして書かれていますが、公式のマニュアルではありませんので、日本語で書かれた参考情報としてご覧になってください。 |
Sun OpenSSO Enterprise 8.0 の公式のマニュアルは、docs.sun.com の以下のサイトでご覧になれます。 |
このページでは、Glassfish 用の J2EE Agent 3.0 のインストール手順を実際の例を用いて説明します。
この例での前提条件:
- オペレーティングシステムは、Solaris 10 sparc である。
- マシンのホスト名は、my.test.domain.com である。
- Glassfish 上には 2 つのドメイン domain2(http ポート 2840)と domain3(http ポート 2680、管理コンソールのポート 34848) が作成済みである。
- opensso.war は Glassfish のポート 2840 番のドメインに配備済みである。
- ポリシーエージェントのインストールは、domain3 に対して行う。
- ポリシーエージェントのバイナリはダウンロード済みである。
1. ポリシーエージェントの zip ファイルを解凍する
ダウンロード済みの appserver_v9_agent_3.zip を /workspace ディレクトリにコピーして、unzip コマンドで解凍します。
# cp appserver_v9_agent_3.zip /workspace
# cd /workspace
# unzip appserver_v9_agent_3.zip
解凍が終わると、j2ee_agents というディレクトリが生成されています。
j2ee_agents/appserver_v9_agent/bin ディレクトリに移動します。
# cd j2ee_agents/appserver_v9_agent/bin
# ls
agentadmin agentadmin.bat
bin ディレクトリには、2つのスクリプトがあります。agentadmin は Unix 用で、agentadmin.bat は、Windows 用です。ここでは、agentadmin を用います。
デフォルトでは、agentadmin ファイルには実行権が付与されていないので、実行可能となるようにファイルのパーミッションを変えます。
# ls -l agentadmin
-rw-r--r-- 1 root root 1525 10月 31日 10:59 agentadmin
# chmod u+x agentadmin
# ls -l agentadmin
-rwxr--r-- 1 root root 1525 10月 31日 10:59 agentadmin
これで、agentadmin スクリプトが実行可能となります。
2. agentapp.war ファイルを Glassfish に配備する
ポリシーエージェントをインストールするドメイン(domain3)に、agentapp.war を配備します。
Glassfish 上に war ファイルを配備する方法としては、コマンドラインを使う方法と、Glassfish の管理コンソールを使う 2 通りの方法があります。どちらの方法でもかまいません。
例えば、コマンドラインを使う場合は、以下のようにして配備します。
# /opt/SUNWappserver/bin/asadmin deploy --port 34848 agentapp.war
管理ユーザー名を入力してください > admin
管理パスワードを入力してください > (admin のパスワードを入力する)
コマンド deploy は正常に実行されました。
3. ポリシーエージェントをインストールする Glassfish のドメインを停止する
これは非常に重要な手順です。
ポリシーエージェントをインストールする際には、あらかじめインストール先となる Glassfish のドメイン(この例では、domain3) を停止しておいてください。
もし停止しないままインストールを行うと、ポリシーエージェントの起動に必要なクラスパスの設定が正しく行われません。
以下のコマンドでドメインを停止します。
# /opt/SUNWappserver/bin/asadmin stop-domain domain3
ドメイン domain3 が停止しました。
4. パスワードファイルを用意する
次にポリシーエージェントのインストール時に使うパスワードファイルを用意します。
ここでは、/export/passwd.txt というファイルに password という文字列を書いておきます。
これにより、エージェントプロファイルのパスワードは password となります。
# echo "password" > /export/passwd.txt
これでインストールのための準備が完了です。
5. ポリシーエージェントのインストール
エージェントのインストールは、agentinstall --install というコマンドを実行して行います。
以下に、実際のインストール例を載せます。
(説明箇所は赤字で書きます。)
# ./agentadmin --install
Please read the following License Agreement carefully:
[Press <Enter> to continue...] or [Enter n To Finish]
n ← ここでは簡略化のため n を入力して License 表示をスキップする
Do you completely agree with all the terms and conditions of this License
Agreement (yes/no): [no]: yes ← yes を入力して License に同意する
************************************************************************
Welcome to the OpenSSO Policy Agent 3.0 for Sun Java System Application
Server 8.1/8.2/9.0/9.1.
************************************************************************
Enter the complete path to the directory which is used by Application Server
to store its configuration Files. This directory uniquely identifies the
Application Server instance that is secured by this Agent.
[ ? : Help, ! : Exit ]
Enter the Application Server Config Directory Path
[/opt/SUNWappserver/domains/domain1/config]: /opt/SUNWappserver/domains/domain3/config
↑エージェントをインストールするドメイン(domain3)の config ディレクトリを指定する。
Enter the URL where the OpenSSO server is running. Please include the
deployment URI also as shown below:
(http://opensso.sample.com:58080/opensso)
[ ? : Help, < : Back, ! : Exit ]
OpenSSO server URL: http://my.test.domain.com:2840/opensso
↑配備済みの OpenSSO の URL を指定する。
Enter the Agent URL. Please include the deployment URI also as shown below:
(http://agent1.sample.com:1234/agentapp)
[ ? : Help, < : Back, ! : Exit ]
Agent URL: http://my.test.domain.com:2680/agentapp
↑手順 2 で配備した agentapp の URL を指定する。
Enter the Agent profile name
[ ? : Help, < : Back, ! : Exit ]
Enter the Agent Profile name: as9agent
↑ エージェントのプロファイル名を指定する。ここでは、as9agent とします。(この名前は、あとで OpenSSO 上でエージェントのプロファイルを作成する際にも必要となりますので覚えておいてください。)
Enter the path to a file that contains the password to be used for identifying
the Agent.
[ ? : Help, < : Back, ! : Exit ]
Enter the path to the password file: /export/passwd.txt
↑手順 4 で用意したパスワードファイルを指定する。
-----------------------------------------------
SUMMARY OF YOUR RESPONSES
-----------------------------------------------
Application Server Config Directory :
/opt/SUNWappserver/domains/domain3/config
Application Server Instance name : server
OpenSSO server URL : http://my.test.domain.com:2840/opensso
Agent URL : http://my.test.domain.com:2680/agentapp
Agent Profile name : as9agent
Agent Profile Password file name : /export/passwd.txt
Verify your settings above and decide from the choices below.
1. Continue with Installation
2. Back to the last interaction
3. Start Over
4. Exit
Please make your selection [1]:
Creating a backup for file
/opt/SUNWappserver/domains/domain3/config/login.conf ...DONE.
Creating a backup for file
/opt/SUNWappserver/domains/domain3/config/server.policy ...DONE.
Adding Agent Realm to
/opt/SUNWappserver/domains/domain3/config/login.conf file ...DONE.
Adding java permissions to
/opt/SUNWappserver/domains/domain3/config/server.policy file ...DONE.
Creating directory layout and configuring Agent file for Agent_001
instance ...DONE.
Reading data from file /export/passwd.txt and encrypting it ...DONE.
Generating audit log file name ...DONE.
Creating tag swapped OpenSSOAgentBootstrap.properties file for instance
Agent_001 ...DONE.
Creating a backup for file
/opt/SUNWappserver/domains/domain3/config/domain.xml ...DONE.
Adding Agent parameters to
/opt/SUNWappserver/domains/domain3/config/domain.xml file ...DONE.
SUMMARY OF AGENT INSTALLATION
-----------------------------
Agent instance name: Agent_001
Agent Bootstrap file location:
/workspace/j2ee_agents/appserver_v9_agent/Agent_001/config/OpenSSOAgentBootstrap.properties
Agent Configuration file location
/workspace/j2ee_agents/appserver_v9_agent/Agent_001/config/OpenSSOAgentConfiguration.properties
Agent Audit directory location:
/workspace/j2ee_agents/appserver_v9_agent/Agent_001/logs/audit
Agent Debug directory location:
/workspace/j2ee_agents/appserver_v9_agent/Agent_001/logs/debug
Install log file location:
/workspace/j2ee_agents/appserver_v9_agent/installer-logs/audit/install.log
Thank you for using OpenSSO Policy Agent 3.0.
#
このような感じでインストールが完了します。
最後に、Glassfish のドメイン(domain3)を再起動して完了です。
# /opt/SUNWappserver/bin/asadmin start-domain domain3

