|
The ActiveMQ Web Console is a web based administration tool for working with ActiveMQ. When used with the JMX support it can be an invaluable tool for working with ActiveMQ Running the Web Console on ActiveMQ 5.0 or laterWe have integrated the Web Console into the binary distribution. So Download a binary distribution then follow the instructions for Version 5 Run Broker. Then you can point your web browser at the URL And hey presto, you should now have the Web Console running. Configuring the Web Console via xbean:activemq.xmlThe integrated Web Console uses Jetty to host the Web Console. Jetty has a compact XML syntax for configuration within the activemq.xml configuration. See http://docs.codehaus.org/display/JETTY/XBean+Support Running the Web Console on earlier versionsTo run the ActiveMQ Web Console on earlier versions of ActiveMQ follow these instructions
mvn clean install -Dmaven.test.skip=true
cd activemq-web-console
mvn jetty:run
Now point your browser at http://localhost:8080/activemq-web-console/ And you should be in business! Changing the portIf you want to change the port number of the web application try the following mvn jetty:run -Djetty.port=9090 You can also set the port with the port attribute in the nioConnector tag in the activemq.xml configuration file: <connectors> <nioConnector port="8161" /> </connectors> Starting the Web Console in a seperate VM/in a Web-ContainerIf you want to start the web-console in a different process than ActiveMQ (f.e. for security or reliability reasons) then you've two options: Configure using System-PropertiesDeploy the activemq-web-console.war into a Web-Container (f.e. Jetty, Tomcat) and specify the following System properties
Configure using JNDIDeploy the activemq-web-console.war into a Web-Container (f.e. Jetty, Tomcat) and specify the following System property
Don't forget to add the activemq-all jar to your webcontainer's shared lib directory (common/lib for tomcat, lib for jetty). Failover configurationsIt's possible to configure the web-console to monitor master/slave-broker setup. To do so use the normal failover: Syntax for the JMS-URL and a comma separated list of JMX-URLs. This works with the System-property- and with the JNDI-configuration. Example configuration using Jetty 6To start the web-console in a dedicated jetty use the following startup-script (execute from the jetty-root-dir): java -Dwebconsole.type=properties -Dwebconsole.jms.url=tcp://localhost:61616 -Dwebconsole.jmx.url=service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi -jar start.jar
If the web-console should be password protected (BASIC Authentication) use the standard jetty mechanisms: <Set name="UserRealms"> <Array type="org.mortbay.jetty.security.UserRealm"> <Item> <New class="org.mortbay.jetty.security.HashUserRealm"> <Set name="name">ActiveMQ Realm</Set> <Set name="config"><SystemProperty name="jetty.home" default="."/>/etc/amqrealm.properties</Set> </New> </Item> </Array> </Set> 2. Configure the users/passwords in the amqrealm.properties in jetty/etc myAdmin: secret,amqAdmin 3. Configure the security constraint either in the webconsoles web.xml or in jetty's webdefault.xml <security-constraint>
<web-resource-collection>
<web-resource-name>A Protected Page</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>amqAdminrole-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>ActiveMQ Realm</realm-name>
</login-config>
This is just a sample configuration of a password protected webconsole. Instead of the HashUserRealm one could also use a KerberosRealm or a JDBCRealm. Example configuration using TomcatTo start web console in Tomcat 5.x use the following steps:
JAVA_OPTS="-Dwebconsole.type=properties \ -Dwebconsole.jms.url=tcp://localhost:61616 \ -Dwebconsole.jmx.url=service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi \ -Dwebconsole.jmx.role= \ -Dwebconsole.jmx.password="
Using the Web ConsoleTo get started, go to the Send Now that you have sent messages to a queue you should be able to Browse |