4.2. Configuring local and remote access to AMQ Management Console
The procedure in this section shows how to configure local and remote access to AMQ Management Console.
Remote access to the console can take one of two forms:
- Within a console session on a local broker, you use the Connect tab to connect to another, remote broker
- From a remote host, you connect to the console for the local broker, using an externally-reachable IP address for the local broker
Prerequisites
-
You must upgrade to at least AMQ Broker 7.1.0. As part of this upgrade, an access-management configuration file named
jolokia-access.xmlis added to the broker instance. For more information about upgrading, see Upgrading a Broker instance from 7.0.x to 7.1.0.
Procedure
-
Open the
<broker_instance_dir>/etc/bootstrap.xmlfile. Within the
webelement, observe that the web port is bound only tolocalhostby default.<web path="web"> <binding uri="http://localhost:8161"> <app url="redhat-branding" war="redhat-branding.war"/> <app url="artemis-plugin" war="artemis-plugin.war"/> <app url="dispatch-hawtio-console" war="dispatch-hawtio-console.war"/> <app url="console" war="console.war"/> </binding> </web>To enable connection to the console for the local broker from a remote host, change the web port binding to a network-reachable interface. For example:
<web path="web"> <binding uri="http://0.0.0.0:8161">In the preceding example, by specifying
0.0.0.0, you bind the web port to all interfaces on the local broker.-
Save the
bootstrap.xmlfile. -
Open the
<broker_instance_dir>/etc/jolokia-access.xmlfile. Within the
<cors>(that is, Cross-Origin Resource Sharing) element, add anallow-originentry for each HTTP origin request header that you want to allow to access the console. For example:<cors> <allow-origin>*://localhost*</allow-origin> <allow-origin>*://192.168.0.49*</allow-origin> <allow-origin>*://192.168.0.51*</allow-origin> <!-- Check for the proper origin on the server side, too --> <strict-checking/> </cors>In the preceding configuration, you specify that the following connections are allowed:
Connection from the local host (that is, the host machine for your local broker instance) to the console.
-
The first asterisk (
*) wildcard character allows either thehttporhttpsscheme to be specified in the connection request, based on whether you have configured the console for secure connections. - The second asterisk wildcard character allows any port on the host machine to be used for the connection.
-
The first asterisk (
-
Connection from a remote host to the console for the local broker, using the externally-reachable IP address of the local broker. In this case, the externally-reachable IP address of the local broker is
192.168.0.49. -
Connection from within a console session opened on another, remote broker to the local broker. In this case, the IP address of the remote broker is
192.168.0.51.
-
Save the
jolokia-access.xmlfile. -
Open the
<broker_instance_dir>/etc/artemis.profilefile. To enable the Connect tab in the console, set the value of the
Dhawtio.disableProxyargument tofalse.-Dhawtio.disableProxy=false중요It is recommended that you enable remote connections from the console (that is, set the value of the
Dhawtio.disableProxyargument tofalse) only if the console is exposed to a secure network.Add a new argument,
Dhawtio.proxyWhitelist, to theJAVA_ARGSlist of Java system arguments. As a comma-separated list, specify IP addresses for any remote brokers that you want to connect to from the local broker (that is, by using the Connect tab within a console session running on the local broker). For example:-Dhawtio.proxyWhitelist=192.168.0.51Based on the preceding configuration, you can use the Connect tab within a console session on the local broker to connect to another, remote broker with an IP address of
192.168.0.51.-
Save the
aretmis.profilefile.
Additional resources
- To learn how to access the console, see 4.3절. “Accessing AMQ Management Console”.
For more information about:
- Cross-Origin Resource Sharing, see W3C Recommendations.
- Jolokia security, see Jolokia Protocols.
- Securing connections to the console, see 4.4.3절. “Securing network access to AMQ Management Console”.