HomeDocumentation > 3. 導入
{scrollbar}

ここでは Apache Geronimo の導入に関して詳細を記述します。前提となるソフトウェアが何か、Geronimo をどこからダウンロードすればいいのか、デフォルトではないポートを使用したカスタマイズされた導入について、などを採り上げます。 

リモートの Web サーバーによる2層トポロジーでの導入や構成に関しても、詳細を後述しています。

本章は下記セクションで構成されています。

20pxdisc

前提となるソフトウェア

Apache Geronimo v2.0 のビルド環境として J2SE 1.5 上で Maven 2 を使用します。下記サイトより適切なバージョンの JVM を入手します。

Geronimo のダウンロード

Geronimo v2.0 のソース・コードおよびバイナリーは下記 URL より入手します。

http://geronimo.apache.org/downloads.html

ソースからのビルド

コマンド・ラインのコンソールから、ソース・コード (.zip または tar.gz) を解凍し、ディレクトリーを <geronimo_home> に変更します。
以下のコマンドをコマンド・ラインより入力し、Apache Geronimo をビルドします。 

mvn install

ソースからの Geronimo のビルドに関しての詳細なステップと要件については、"Building Apache Geronimo with Maven 2" のセクションで解説しています。

バイナリーからの Geronimo 導入

Apache Geronimo を導入・実行したいプラットフォームに合わせて、適切な導入イメージをダウンロード してください。 オペレーティング・システムに合った圧縮フォーマット(.zip, .tar.gz) を選択します。リンクをクリック、ダウンロードし、ハード・ディスクの新しいディレクトリーにバイナリーを展開します。

Apache Geronimo の導入は zip/tar ファイルを解凍するだけのシンプルさです!コマンド・ラインからディレクトリーを <geronimo_home>/bin に変更し、下記コマンドを使用しサーバーを始動してください。 

geronimo run

Apache Geronimo はサーバー/アプリケーション管理用に便利な一連のスクリプトを提供しています。詳細は  1.9. ツールとコマンド セクションをご覧ください。

デフォルトのポート変更  

HTTP ポートは Web コンテナが使用する標準ネットワークです。このポート番号は、Geronimo 上で稼動する Web アプリケーションを呼び出す、どの HTTP URL でも使用されます。Geronimo のサーバーおよび始動構成の各モジュールは config.xml によって制御され、デフォルトの HTTP リスナーはポート番号が 8080 で構成されます。

ネットワークのポートを変更するのにはいくつか理由があり、それによってGeronimo のインスタンスを複数実行させることができます。 デフォルトのポートを構成するには <geronimo_home>/var/config/config.xml ファイルを編集します。Apache Geronimo v2.0 (Tomcat ディストリビューション版) での config.xml を例として下記に掲載します。 

xmlsolidconfig.xml <?xml version="1.0" encoding="UTF-8"?> <!-- ======================================================== --> <!-- Warning - This XML file is re-generated by Geronimo when --> <!-- changes are made to Geronimo's configuration, therefore --> <!-- any comments added to this file will be lost. --> <!-- Do not edit this file while Geronimo is running. --> <!-- ======================================================== --> <attributes xmlns="http://geronimo.apache.org/xml/ns/attributes-1.1"> <module name="org.apache.geronimo.configs/rmi-naming/2.0-M2/car"> <gbean name="RMIRegistry"> <attribute name="port">1099</attribute> </gbean> <gbean name="NamingProperties"> <attribute name="namingProviderUrl">rmi://0.0.0.0:1099</attribute> </gbean> <gbean name="DownloadedPluginRepos"> <attribute name="repositoryList">http://geronimo.apache.org/plugins/plugin-repository-list-2.0.txt</attribute> <attribute name="userRepositories">[]</attribute> </gbean> </module> <module name="org.apache.geronimo.configs/j2ee-server/2.0-M2/car"/> <module name="org.apache.geronimo.configs/transaction-jta11/2.0-M2/car"/> <module name="org.apache.geronimo.configs/j2ee-security/2.0-M2/car"> <gbean name="JaasLoginServiceRemotingServer"> <attribute name="host">0.0.0.0</attribute> <attribute name="port">4242</attribute> </gbean> <gbean name="JMXService"> <attribute name="protocol">rmi</attribute> <attribute name="host">0.0.0.0</attribute> <attribute name="port">9999</attribute> <attribute name="urlPath">/jndi/rmi://0.0.0.0:1099/JMXConnector</attribute> </gbean> </module> <module name="org.apache.geronimo.configs/axis/2.0-M2/car"/> <module load="false" name="org.apache.geronimo.configs/axis2/2.0-M2/car"/> <module load="false" name="org.apache.geronimo.configs/cxf/2.0-M2/car"/> <module name="org.apache.geronimo.configs/openejb/2.0-M2/car"/> <module load="false" name="org.apache.geronimo.configs/j2ee-corba-yoko/2.0-M2/car"> <gbean name="NameServer"> <attribute name="port">1050</attribute> <attribute name="host">localhost</attribute> </gbean> </module> <module load="false" name="org.apache.geronimo.configs/j2ee-corba-sun/2.0-M2/car"> <gbean name="NameServer"> <attribute name="port">1050</attribute> <attribute name="host">localhost</attribute> </gbean> </module> <module name="org.apache.geronimo.configs/system-database/2.0-M2/car"> <gbean name="DerbyNetwork"> <attribute name="host">0.0.0.0</attribute> <attribute name="port">1527</attribute> </gbean> </module> <module name="org.apache.geronimo.configs/activemq-broker/2.0-M2/car"> <gbean name="ActiveMQ.tcp.default"> <attribute name="host">0.0.0.0</attribute> <attribute name="port">61616</attribute> </gbean> </module> <module name="org.apache.geronimo.configs/activemq/2.0-M2/car"/> <module name="org.apache.geronimo.configs/tomcat6/2.0-M2/car"> <gbean name="TomcatResources"/> <gbean name="TomcatWebConnector"> <attribute name="host">0.0.0.0</attribute> <attribute name="port">8080</attribute> <attribute name="redirectPort">8443</attribute> </gbean> <gbean name="TomcatAJPConnector"> <attribute name="host">0.0.0.0</attribute> <attribute name="port">8009</attribute> <attribute name="redirectPort">8443</attribute> </gbean> <gbean name="TomcatWebSSLConnector"> <attribute name="host">0.0.0.0</attribute> <attribute name="port">8443</attribute> </gbean> <gbean name="org.apache.geronimo.configs/tomcat6/2.0-M2/car?ServiceModule=org.apache.geronimo.configs/tomcat6/2.0-M2/car,j2eeType=GBean,name=TomcatWebContainer"> <attribute name="catalinaHome">var/catalina</attribute> </gbean> </module> <module name="org.apache.geronimo.configs/geronimo-gbean-deployer/2.0-M2/car"/> <module name="org.apache.geronimo.configs/j2ee-deployer/2.0-M2/car"> <gbean name="WebBuilder"> <attribute name="defaultNamespace">http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.2</attribute> </gbean> <gbean name="EnvironmentEntryBuilder"> <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute> </gbean> </module> <module name="org.apache.geronimo.configs/connector-deployer/2.0-M2/car"> <gbean name="ResourceRefBuilder"> <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute> </gbean> <gbean name="AdminObjectRefBuilder"> <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute> </gbean> </module> <module name="org.apache.geronimo.configs/persistence-jpa10-deployer/2.0-M2/car"/> <module name="org.apache.geronimo.configs/openejb-deployer/2.0-M2/car"> <gbean name="EJBBuilder"> <reference name="ServiceBuilders"> <pattern> <name>GBeanBuilder</name> </pattern> <pattern> <name>PersistenceUnitBuilder</name> </pattern> </reference> <reference name="WebServiceBuilder"> <pattern> <name>CXFBuilder</name> </pattern> <pattern> <name>Axis2Builder</name> </pattern> <pattern> <name>WebServiceBuilder</name> </pattern> </reference> </gbean> <gbean name="EjbRefBuilder"> <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute> </gbean> <gbean name="ClientEjbRefBuilder"> <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute> </gbean> </module> <module name="org.apache.geronimo.configs/client-deployer/2.0-M2/car"/> <module name="org.apache.geronimo.configs/cxf-deployer/2.0-M2/car"/> <module name="org.apache.geronimo.configs/axis2-deployer/2.0-M2/car"/> <module name="org.apache.geronimo.configs/axis-deployer/2.0-M2/car"> <gbean name="AxisServiceRefBuilder"> <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute> </gbean> </module> <module name="org.apache.geronimo.configs/javamail/2.0-M2/car"> <gbean name="SMTPTransport"> <attribute name="host">localhost</attribute> <attribute name="port">25</attribute> </gbean> </module> <module name="org.apache.geronimo.configs/sharedlib/2.0-M2/car"> <gbean name="SharedLib"> <attribute name="classesDirs">var/shared/classes</attribute> <attribute name="libDirs">var/shared/lib</attribute> </gbean> </module> <module name="org.apache.geronimo.configs/tomcat6-deployer/2.0-M2/car"/> <module name="org.apache.geronimo.configs/welcome-tomcat/2.0-M2/car"/> <module name="org.apache.geronimo.configs/webconsole-tomcat/2.0-M2/car"/> <module load="false" name="org.apache.geronimo.configs/uddi-tomcat/2.0-M2/car"/> <module name="org.apache.geronimo.configs/remote-deploy-tomcat/2.0-M2/car"/> <module name="org.apache.geronimo.configs/hot-deployer/2.0-M2/car"/> <module load="false" name="org.apache.geronimo.configs/ca-helper-tomcat/2.0-M2/car"/> <module name="console.dbpool/LocalDB/1.0/rar"/> <module name="console.dbpool/jdbc%2FTradeDataSource/1.0/rar"/> </attributes>

ここで、config.xml ファイルからの抜粋による例を2つご紹介します。一つは Tomcat 版で、もう一つは Jetty 版です。これら抜粋ではリスナーが定義されている全セクションを掲載しています。ここで、標準の 8080 ポートを、任意のポート(ここでは 9000) で置き換えてみましょう。

xmlsolidExcerpt from config.xml - Tomcat <module name="org.apache.geronimo.configs/tomcat6/2.0-M2/car"> <gbean name="TomcatResources"/> <gbean name="TomcatWebConnector"> <attribute name="host">0.0.0.0</attribute> <attribute name="port">9000</attribute> <attribute name="redirectPort">8443</attribute> </gbean> <gbean name="TomcatAJPConnector"> <attribute name="host">0.0.0.0</attribute> <attribute name="port">8009</attribute> <attribute name="redirectPort">8443</attribute> </gbean> <gbean name="TomcatWebSSLConnector"> <attribute name="host">0.0.0.0</attribute> <attribute name="port">8443</attribute> </gbean> <gbean name="org.apache.geronimo.configs/tomcat6/2.0-M2/car?ServiceModule=org.apache.geronimo.configs/tomcat6/2.0-M2/car,j2eeType=GBean,name=TomcatWebContainer"> <attribute name="catalinaHome">var/catalina</attribute> </gbean> </module> xmlsolidExcerpt from config.xml - Jetty <module name="org.apache.geronimo.configs/jetty6/2.0-M2/car"> <gbean name="JettyWebConnector"> <attribute name="host">0.0.0.0</attribute> <attribute name="port">9000</attribute> <attribute name="redirectPort">8443</attribute> </gbean> <gbean name="JettySSLConnector"> <attribute name="host">0.0.0.0</attribute> <attribute name="port">8443</attribute> </gbean> </module> <module name="org.apache.geronimo.configs/geronimo-gbean-deployer/2.0-M2/car"/> <module name="org.apache.geronimo.configs/j2ee-deployer/2.0-M2/car"> <gbean name="WebBuilder"> <attribute name="defaultNamespace">http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.2</attribute> </gbean> <gbean name="EnvironmentEntryBuilder"> <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute> </gbean> </module>

ファイルを保存し、サーバーを再起動します。 新しい構成情報をロードし、新たに割り当てたポートをブラウザーに指定します。

http://localhost:9000/console

ユーザー名とパスワードの変更

Apache Geronimo 導入時はデフォルトのユーザー名 - system およびパスワード - manager が使用されています。これらの変更には3つのオプションがあります。

  1. *.properties ファイルを手動で編集する
  2. 管理コンソールからセキュリティ構成を更新する
  3. 新規のセキュリティ・レルムを作成する

この最後のオプションについては、1.1.3. セキュリティの構成 のセクションで詳細に述べられています。

*.properties ファイルのマニュアルでの変更

<geronimo_home>/var/security/groups.properties ファイルを開き、編集します。 必要なユーザー名を追加し、ファイルを保存します。

solidgroups.properties admin=user1,user2

次に <geronimo_home>/var/security/users.properties ファイルを開きます。既存ユーザーのパスワード変更や、新規ユーザー追加ができます。 新規ユーザーを追加する場合は、groups.properties ファイルに追加したものと同じにしてください。

solidusers.properties user1=password1 user2=password2

この例では、2ユーザー ( user1 / user2 ) を追加し、デフォルトのシステム・アカウントは削除しています。user1 / user2 の両方ともコンソールやコマンド・ライン・デプロイメント・ツールにアクセスできます。

管理コンソールからセキュリティ構成の変更

コンソールにログインし、コンソール・ナビゲーション・パネル上で Console Realm をクリックします。これによって、 Console Realm UsersConsole Realm Groups ポートレットが表示されます。

  • "Create New User" リンクをクリックし、新規ユーザーの追加、もしくは Details にて既存ユーザーを編集します。
  • "Create New Group" リンクをクリックし、グループに新規ユーザーを追加します。
  • 新規のユーザー名とパスワードが追加されたら、コンソールからログアウトし、新しいユーザー名とパスワードを試してみてください。

Apache Geronimo v2.0 でのセキュリティ構成に関しては、1.1.3. セキュリティの構成 のセクションで詳細に述べられています。

トポロジー

今日のグローバリズムが進んだ世界では、組織が日常的に直面するオポチュニティーやチャレンジは多数存在し、組織を支える IT インフラへの責任の重大さからも柔軟・迅速な構成が組めるかどうかが決め手になります。 Apache Geronimo アプリケーション・サーバーは中堅企業向けアプリケーションをサポートし最新の J2EE 仕様に対しても堅牢でセキュアなサポートを提供します。このセクションでは、皆さんご自身の本番環境で使用可能な、いくつかの構成オプションをご紹介します。

2層システム

下図では、Geronimo サーバーにホストされているアプリケーションに接続するクライアントを示しています。図には1台のクライアント・マシンしか記載されていませんが、複数マシンの場合でもサーバーへ接続可能です。それらマシン上のユーザーは、標準的な Web ブラウザーを使用して、Geronimo サーバーにホストされた Web アプリケーションに接続できます。

クライアント側のアプリケーションは範囲が広く、単純なコマンド・ライン・インターフェースから、GUI で作成されたインターフェースまであります。これらアプリケーションは HTTP 接続を使用しサーバーに接続することで Web 層に接続します。 ビジネス/EIS 層へは、Geronimo クライアント・アプリケーション・コンテナーを通して接続します。
(参考URL: http://www.ibm.com/developerworks/jp/opensource/library/os-ag-client/index.html)

Geronimo アプリケーション・クライアントの特徴:

  • Geronimo サーバーとの分離
  • Geronimo サーバーとのコミュニケーションはネットワークを介して実施
  • クライアント・アプリケーションとのマッピング上、疎結合の簡易な仕組みを提供


3層システム

3層アーキテクチャーによるシステムは2層よりもスケーラブルで、多人数の人と組織に対応可能で、柔軟性と自由度が増します。


Apache HTTPd での構成

Apache web サーバーはもっともポピュラーな HTTP サーバーとして今日のインターネット環境で利用されています。本番環境で Geronimo を Apache web サーバーと合わせて使用することで、 下記にあげた利点を享受できます。

  1. クラスタリング&ロード・バランシング

クラスタリングによってアプリケーション・サーバーは複数ノードのフェイルオーバーやセッション・データ共有、およびロード・バランシングを、ネットワーク上の多数のノード間にわたってサポートします。アプリケーションのロード・バランシングは、Apache サーバーに組み込まれた機能によってサポートされます。

  2. SSL エンコーダー


Web サーバー・プロキシの利点は、追加のハードウェアなしに、SSL で暗号化されたメッセージをサーバーへ安全に提供することです。 しかし広範囲にわたる SSL プロセシングはプロキシに対して負荷をかけることになります。 それを処理するのが Apache サーバーになります。一方で、Geronimo はアプリケーションのビジネス・ロジックをつかさどります。
    3. アプリケーション・ロード・シェアリング

サーバー環境の多くでは、web サーバーとアプリケーション・サーバーが一緒に稼動し、すべての HTTP リクエストを取り扱います。 Apache が扱うのは静的ページ(HTML, JPEG, GIF など)で、Geronimo はTomcat / Jetty のサポートにより動的ページ(JSP, サーブレット)を扱います。 Geronimo サーバーも静的なページを扱いますが、両者混合のシステムでは、通常動的なリクエストを扱うよう構成されます。

サマリー

Geronimo アプリケーション・サーバーを使用することによって、セキュアなエンタープライズ・インフラストラクチャーを構築し、最新の技術標準や要件に適合します。 ここでは標準的な Geronimo の導入に対してのカスタム構成を、いくつかの導入例を通して洞察しました。