JBoss 4.2に外部からアクセスできない!?
いつもどおりJBossをセットアップしていたらローカル環境からは
アクセスできるけど他のPCからアクセスできない!?
も~あわてんぼうですねぇ
ちゃんと付属のreadme.html読んでますか??
JBoss4.2からセキュリティー上の観点からバインド(監視)するアドレスの
デフォルト(初期設定)が127.0.0.1(稼動PC自身)になったのです。
いままで(4.0.x系)は全てのIPアドレスをバインドしていました(設定0.0.0.0)
◆公式文書(readme.htmlより)
JBossAS now binds its services to localhost (127.0.0.1) *by default*, instead of binding to all available interfaces (0.0.0.0). This was primarily done for security reasons because of concerns of users going to production without having secured their servers properly. To enable remote access by binding JBoss services to a particular interface, simply run jboss with the -b option, but be aware you still need to secure you server properly.
となっています。
セキュリティ的にはこの状態も望ましいかもしれません。
とりあえず今までと同じように動作させたい場合 -b オプションを使って
/usr/local/jboss/bin/run.sh -b 0.0.0.0
のようにバインドするIPを通知してあげればOKです。
JBossが直接クラアントと通信しない場合(AJP[mod_jk]等を経由しApacheと連携など)
デフォルトの設定はセキュリティー的にたいへん強固です。
そのばあい8009ポートなど通信に使用するポートだけをグローバルIPで監視するように
個別に設定します。
ちなみにAJP13-mod_jkでWEBサーバーと連携している場合は
/jboss/server/default/deploy/jboss-web.deployer/server.xml
<Connector port="8009" address="${jboss.bind.address}" protocol="AJP/1.3"
emptySessionPath="true" enableLookups="false" redirectPort="8443" />
↓ ↓ ↓
<Connector port="8009" address="123.456.789.123" protocol="AJP/1.3"
emptySessionPath="true" enableLookups="false" redirectPort="8443" />
上記のように設定します。
*注:JBossが稼動しているサーバーのアドレスが(123.456.789.123)のとき
ちゃんとreadmeにかいてあるのにこんなのに4時間近く使うなんてまったく(=_=;
反省します。
| 固定リンク

コメント
非常に参考になりました。ありがとうございます
投稿: NoName | 2009年1月18日 (日) 20時20分