2011-07-19 84 views
7

我試圖在jboss 7中從jboss 4運行我的應用程序。在jboss 4中,我們更改了server.xml以配置keystoreFile和keystorePass等。任何人都可以幫助我在何處進行這些更改在jboss7中。在JBoss AS 7中相當於server.xml

回答

4

Jboss 7中的server.xml等價物是獨立安裝的standalone/configuration/standalone.xml,以及可識別域的server.xml。

我不確定這些選項在哪裏,或者你應該如何在Jboss 7中配置它,但是首先從standalone.xml文件開始。

2

您應該避免自己觸摸配置XML。
而是讓它達到域控制器主機控制器
並通過這裏提到的方式配置您的服務器: JBoss AS 7 JMX Console

更新:

  • 對於手動配置,嘗試Web UI - http://localhost:9990/

  • 對於自動配置,請嘗試CLI scripts

  • 要開發和調試CLI命令,請嘗試jboss-cli.sh --gui

但如果你真的必須的,它在standalone/configuration/standalone.xml

<subsystem xmlns="urn:jboss:domain:web:1.0" ...> 

的模式是在這裏:http://www.jboss.org/schema/jbossas/jboss-as-web_1_2.xsd
or later versions)。

4

編輯文件standalone/configuration/standalone.xml

<subsystem xmlns="urn:jboss:domain:web:1.0" default-virtual-server="default-host"> 
    <connector name="http" scheme="http" protocol="HTTP/1.1" socket-binding="http"/> 
    <virtual-server name="default-host" enable-welcome-root="true"> 
     <alias name="localhost" /> 
     <alias name="example.com" /> 
    </virtual-server> 
</subsystem> 

更換thew connector標籤具有下列之一:

<connector name="https" scheme="https" protocol="HTTP/1.1" secure =」true」 socket- binding="https" ssl=」your certificate name」/> 
+0

我在哪裏必須放置證書?任何特殊的地方? – Joerg

+1

@Joerg 您必須在standalone.xml或domain.xml中設置系統屬性javax.net.ssl.trustStore: https://community.jboss.org/thread/172052 –

1

推薦的方式來改變AS 7模型是無論如何通過在命令行界面的手段。例如,您可以將HTTP端口的套接字綁定端口設置爲8090:

/socket-binding-group = standard-sockets/socket-binding = http:write-attribute(name =「port」,值爲「8090」)

0

JBoss EAP 7使用Undertow網絡服務器並通過undertow子系統(它取代了以前版本中使用的web子系統)對其進行配置。在Setting up an SSL/TLS for Applications中描述了使用CLI進行SSL/TLS設置。如果您想直接修改standalone.xml文件,指令可以翻譯爲:

  1. 添加和配置HTTPS安全領域。 - /server/management/security-realms下添加HTTPS security-realm元素,例如

    <security-realm name="HTTPSRealm"> 
        <server-identities> 
         <ssl> 
          <keystore path="/path/to/your/keystore/myKeystore.jks" 
            keystore-password="myKeystorePassword" 
            alias="mySSLKeyPairAlias" 
            key-password="mySSLKeyPairPassword" /> 
         </ssl> 
        </server-identities> 
    </security-realm> 
    
  2. 更新使用HTTPS安全領域暗流子系統。 - 在/server/profile找到Undertow子系統元素(例如<subsystem xmlns="urn:jboss:domain:undertow:3.1">)。它向其中添加一個https-listener元素引用您的HTTPSRealm在上述步驟1中創建,例如

    <https-listener name="default-ssl" socket-binding="https" security-realm="HTTPSRealm" /> 
    

更多細節可以在這些相關的鏈接找到一個server子元素: