24.9.2. 配置 ISAPI 连接器以将客户端请求发送到 JBoss EAP
此任务配置一组 JBoss EAP 服务器,以接受来自 ISAPI 连接器的请求。它不包括用于负载平衡或高可用性故障转移的配置。
此配置在 IIS 服务器上完成,并且假定您已将 JBoss EAP 配置为接受来自外部 Web 服务器的请求。您还需要对 IIS 服务器的完整管理员访问权限,并将 IIS 配置为使用 ISAPI 连接器。
创建属性文件和设置重定向
创建用于存储日志、属性文件和锁定文件的目录。
此流程的其余部分假定您为此使用了目录
C:\connectors\
。如果您使用不同的目录,请相应地修改说明。创建
isapi_redirect.properties
文件。创建名为
C:\connectors\isapi_redirect.properties
的新文件。将以下内容复制到 文件。# Configuration file for the ISAPI Connector # Extension uri definition extension_uri=/jboss/isapi_redirect.dll # Full path to the log file for the ISAPI Connector log_file=c:\connectors\isapi_redirect.log # Log level (debug, info, warn, error or trace) log_level=info # Full path to the workers.properties file worker_file=c:\connectors\workers.properties # Full path to the uriworkermap.properties file worker_mount_file=c:\connectors\uriworkermap.properties #Full path to the rewrite.properties file rewrite_rule_file=c:\connectors\rewrite.properties
如果您不想使用
rewrite.properties
文件,请在行首加上#
字符来注释掉最后一行。创建
uriworkermap.properties
文件uriworkermap.properties
文件包含已部署应用程序 URL 之间的映射,以及哪个 worker 处理向它们的请求。下例中的 文件显示了 文件的语法。将您的uriworkermap.properties
文件放在C:\connectors\
中。# images and css files for path /status are provided by worker01 /status=worker01 /images/*=worker01 /css/*=worker01 # Path /web-console is provided by worker02 # IIS (customized) error page is used for http errors with number greater or equal to 400 # css files are provided by worker01 /web-console/*=worker02;use_server_errors=400 /web-console/css/*=worker01 # Example of exclusion from mapping, logo.gif won't be displayed # !/web-console/images/logo.gif=* # Requests to /app-01 or /app-01/something will be routed to worker01 /app-01|/*=worker01 # Requests to /app-02 or /app-02/something will be routed to worker02 /app-02|/*=worker02
创建
workers.properties
文件。Worker
.properties
文件包含 worker 标签和服务器实例之间的映射定义。此文件遵循用于 Apache mod_jk 工作程序属性配置的同一文件的语法。以下是
workers.properties 文件的示例
:工作程序名称(worker01
和worker02
)必须与 JBoss EAPundertow
子系统中配置的instance-id
相匹配。将此文件放入
C:\connectors\
目录中。# An entry that lists all the workers defined worker.list=worker01, worker02 # Entries that define the host and port associated with these workers # First JBoss EAP server definition, port 8009 is standard port for AJP in EAP worker.worker01.host=127.0.0.1 worker.worker01.port=8009 worker.worker01.type=ajp13 # Second JBoss EAP server definition worker.worker02.host=127.0.0.100 worker.worker02.port=8009 worker.worker02.type=ajp13
创建
rewrite.properties
文件。rewrite.properties
文件包含为特定应用重写规则的简单 URL。重写路径使用名称值对来指定,如下例所示。将此文件放入C:\connectors\
目录中。#Simple example # Images are accessible under abc path /app-01/abc/=/app-01/images/
使用
net stop 和 net
start
命令重新启动 IIS 服务器。C:\> net stop was /Y C:\> net start w3svc
IIS 服务器配置为根据特定应用将客户端请求发送到您配置的特定 JBoss EAP 服务器。