Apache Software Foundation | Jakarta Project | Apache Tomcat
Sockets


ソケット

The examples below are working when the Tomcat is configured according the examples described in the configtc file.


以下の例は、configtcファイルに記述された例に従ってTomcatが設定されている場合に動作します。

/example using normal socket


通常のソケットを使用した/examples

Map /examples to the Tomcat /examples context using a normal socket. Note the IP instead localhost (The JVM listens on the IPV4 address not no the IPV6).


通常のソケットを使ってTomcatの/examplesコンテキストを/examplesに割り当てます。 localhostではなくIPであることに注意して下さい (JVMは、IPV6ではなくIPV4のアドレスで待ち受けます)。

[shm]
file=${serverRoot}/logs/shm.file
size=1048576

# Example socket channel, override port and host.
[channel.socket:localhost:8019]
port=8019
host=127.0.0.1

# define the worker
[ajp13:localhost:8019]
channel=channel.socket:localhost:8019

# Uri mapping
[uri:/examples/*]
worker=ajp13:localhost:8019

[shm]
file=${serverRoot}/logs/shm.file
size=1048576

# ソケットチャンネルでポート番号とホスト名を上書きする例
[channel.socket:localhost:8019]
port=8019
host=127.0.0.1

# ワーカの定義
[ajp13:localhost:8019]
channel=channel.socket:localhost:8019

# URI のマッピング
[uri:/examples/*]
worker=ajp13:localhost:8019


/jkstatus

Map /jkstatus to the status worker.


ステータスワーカに対して/jkstatusを割り当てます。

[shm]
file=${serverRoot}/logs/shm.file
size=1048576

# define the worker
[status:status]

# Uri mapping
[uri:/jkstatus/*]
worker=status:status

[shm]
file=${serverRoot}/logs/shm.file
size=1048576

# ワーカの定義
[status:status]

# URI のマッピング
[uri:/jkstatus/*]
worker=status:status


/example using AF_UNIX socket


AF_UNIXソケットを使用した/examples

Map /examples to the Tomcat /examples context using a AF_UNIX socket. Socket file is create by the Tomcat becarefull when the Web Server runs in a different user than the Tomcat with the permission of the socket file:


AF_UNIXソケットを使ってTomcatの/examplesコンテキストを/examplesに割り当てます。 以下がTomcatによって生成されるソケットファイルです。 WebサーバがTomcatとは別のユーザで起動している場合は、 ソケットファイルのパーミッションに注意して下さい。
[訳注: 原文は明らかに間違っていて正確な翻訳は無理ですが、言いたいことは上記の通りと思われます。]

apache20@jfcexpert:~/apache> ls -l /home1/jakarta/jakarta-tomcat-4.1/dist/work/jk2.socket
srw-rw----    1 jakarta  jakarta         0 Jun 20 08:27 /home1/jakarta/jakarta-tomcat-4.1/dist/work/jk2.socket
Here the Tomcat user and the Web Server user must be in the same group.


この通り、TomcatのユーザとWebサーバのユーザは同じグループでなければなりません。

[shm]
file=${serverRoot}/logs/shm.file
size=1048576

# Example unixsocket channel.
[channel.un:unixsocket]
file=/home1/jakarta/jakarta-tomcat-4.1/dist/work/jk2.socket

# define the worker
[ajp13:unixsocket]
channel=channel.un:unixsocket

# Uri mapping
[uri:/examples/*]
worker=ajp13:unixsocket

[shm]
file=${serverRoot}/logs/shm.file
size=1048576

# UNIX Socket チャンネルの例
[channel.un:unixsocket]
file=/home1/jakarta/jakarta-tomcat-4.1/dist/work/jk2.socket

# ワーカの定義
[ajp13:unixsocket]
channel=channel.un:unixsocket

# URI マッピング
[uri:/examples/*]
worker=ajp13:unixsocket



JNI


JNI

[訳注: これは田中良浩が翻訳しました。日本語訳に対するコメントがあれば、こちらに送って下さい。]