Jboss ServiceBindingManager and server.xml: ports and certif



使用 ServiceBindingManager 引用/conf/jboss-service 中的 "sample-bindings.xml" 配置.xml:

   <mbean code="org.jboss.services.binding.ServiceBindingManager"
     name="jboss.system:service=ServiceBindingManager">
     <attribute name="ServerName">myserver</attribute>
     <attribute name="StoreURL">${jboss.home.url}/docs/examples/binding-manager/sample-bindings.xml</attribute>
     <attribute name="StoreFactoryClassName">
       org.jboss.services.binding.XMLServicesStoreFactory
     </attribute>
   </mbean>

1( 启用服务绑定管理器是否意味着"服务器.xml"端口被示例绑定定义的端口覆盖.xml?

<!-- A "Connector" represents an endpoint by which requests are received
     and responses are returned. Documentation at :
     Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
     Java AJP  Connector: /docs/config/ajp.html
     APR (HTTP/AJP) Connector: /docs/apr.html
     Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector port="8080" address="${jboss.bind.address}"
     maxThreads="250" maxHttpHeaderSize="8192"
     emptySessionPath="true" protocol="HTTP/1.1"
     compression="on"
     compressionMinSize="2048"
     noCompressionUserAgents="gozilla, traviata"
     compressableMimeType="text/html,text/xml,text/javascript,application/x-javascript,text/css,text/plain"
     enableLookups="false" redirectPort="8443" acceptCount="100"
     connectionTimeout="20000" disableUploadTimeout="true" server="server1" />
<!-- Define a SSL HTTP/1.1 Connector on port 8443
     This connector uses the JSSE configuration, when using APR, the
     connector should be using the OpenSSL style configuration
     described in the APR documentation -->
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
           maxThreads="250" scheme="https" secure="true"
           maxHttpHeaderSize="8192"
           emptySessionPath="true"
           address="${jboss.bind.address}"
           keystoreFile="${jboss.server.home.dir}/conf/server.keystore"
           keystorePass="xx"
           truststoreFile="${jboss.server.home.dir}/conf/server.keystore"
           truststorePass="xx"
           clientAuth="false" sslProtocol="TLS" server="server1" />

2( 如果服务器.xml端口不再相关,TLS 服务器证书如何仍可使用?

经过一些谷歌搜索,它确实看起来像示例绑定.xml端口将覆盖服务器.xml端口相关设置,主要用于在同一服务器/机器上运行多个 JBoss 实例。 在 SSL 证书上,如果似乎不再找到密钥库 - 您可以在 run.conf 的JAVA_OPTS部分中将它们添加为程序参数(我假设您使用的是旧版本的 JBoss(,或者您可以将它们添加到用于启动 JBoss 的命令行或脚本中,例如:

/home/jboss/jboss-eap-5.1/jboss-as/bin/./run.sh -Djavax.net.ssl.keyStore=server.keystore -Djavax.net.ssl.trustStore=server.keystore -Djavax.net.ssl.trustStorePassword=xx -Djavax.net.ssl.keyStorePassword=xx > /dev/null 2>&1 &

请注意,您需要正确的文件路径。

我们在许多 Jboss 实例上使用相同的密钥库/信任库程序参数。

最新更新