GlassFishとはSun社が提供するオープンソースのアプリケーションサーバです。
作業ディレクトリは/var/tmpとします。
$ cd /var/tmp
GlassFishコミュニティ日本公式サイトより最新版のパッケージファイルをダウンロードします。
$ wget http://java.net/download/javaee5/v2.1_branch/promoted/SunOS_X86/glassfish-installer-v2.1-b60e-sunos_x86.jar
Javaパッケージファイルを実行します。以下は割り当てメモリを256Mと指定した例です。
$ sudo java -Xmx256m -jar glassfish-installer-v2.1-b60e-sunos_x86.jar
エラーとなる場合は割り当てメモリを減らした、下記を実行して下さい。
$ sudo java -Xmx128m -jar glassfish-installer-v2.1-b60e-sunos_x86.jar
下記、標準出力に確認が出るので“A”を入力します。
As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module.? An independent module is a module which is not derived from or based on this library.? If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so.? If you do not wish to do so, delete this exception statement from your version. Accept or Decline? [A,D,a,d] A
処理が進み、下記出力が確認できればインストール成功です。
... glassfish/registry.properties glassfish/LICENSE.txt glassfish/CDDLGPLHeader.txt installation complete
作成されたディレクトリへ移動します。
$ cd glassfish
lib/ant/bin下のファイルを実行する為、パーミッションの変更を行います。
$ chmod -R +x lib/ant/bin
セットアップを実行します。
$ sudo lib/ant/bin/ant -f setup.xml
下記出力が確認出来れば成功です。
... [exec] Make sure that this file remains protected. Information stored in this file will be used by asadmin commands to manage this domain. [delete] Deleting: /var/tmp/glassfish/glassfish/passfile BUILD SUCCESSFUL Total time: 19 seconds
※セットアップ実行時のエラーケース
不要なプロセスを停止させ、メモリに空きを作ってから再度実行ください。
[exec] The file in given locale [ja_JP] at: [/var/tmp/glassfish/glassfish/lib/install/templates/locales/ja_JP/index.html] could not be found. Using default (en_US) index.html instead. [exec] Security Store uses: JKS [exec] Cannot run program "/bin/chmod": error=12, 十分な領域がありません。 [exec] CLI130 Could not create domain, domain1 BUILD FAILED /var/tmp/glassfish/glassfish/setup.xml:177: The following error occurred while executing this line: /var/tmp/glassfish/glassfish/setup.xml:607: exec returned: 1
Glassfishを起動します。
$ asadmin start-domain domain1
ブラウザより以下のアドレスへアクセスし、Glassfishのページが表示される事を確認します。
下記の様に表示されていればGlassfishは正常に動作しています。
今回インストールしたGlassfish関連パスは以下の通りになります。
インストールパス | /var/tmp/glassfish/ |
設定ファイルディレクトリ | /var/tmp/glassfish/config |