CentOS Build Activemq__activemq

Source: Internet
Author: User
Tags iptables

The following actions I see the video operation, the following actions are I built under the root user (build activemq single node)

1, install the JDK and configure the environment variable (slightly configuration environment can be Baidu)


2, to ActiveMQ website download Linux version of the ActiveMQ (I personally downloaded the version of 5.11.1 64)


3, decompression installation $ TAR-ZXVF apache-activemq-5.11.1-bin.tar.gz
$ mv apache-activemq-5.11.1 activemq-01
If the startup script ACTIVEMQ does not have executable permissions, then authorization is required (this step is optional)

If ACTIVEMQ, you do not have to execute the following command
$ CD activemq-01/bin/
$ chmod 755./activemq


4, open the corresponding port in the firewall ActiveMQ need to use two ports
A port that is a message communication (default 61616) can be modified in Conf/activemq.xml
One is the admin console port (the default is 8161) that can be modified in Conf/jetty.xml as follows:
<bean id= "Jettyport" class= "Org.apache.activemq.web.WebConsolePort" init-method= "Start" >
<!--The default port number for the Web console-->
<property name= "host" value= "0.0.0.0"/>
<property name= "Port" value= "8161"/>
</bean>
# Vi/etc/sysconfig/iptables
Add to:
-A input-m state--state new-m tcp-p TCP--dport 61616-j ACCEPT
-A input-m state--state new-m tcp-p TCP--dport 8161-j ACCEPT
Reboot the firewall:
# Service Iptables Restart


5, start $ cd/home/wusc/activemq-01/bin
$./activemq Start

6, open the management interface: http://192.168.98.72:8161/

The default user name and password are: admin/admin

Enter after landing


7, Security Configuration (message Security) ActiveMQ If you do not join the security mechanism, anyone who knows the specific address of the message service (including IP, port, message address
[Queue or Subject address], can be unscrupulous to send, receive messages. About ActiveMQ Installation configuration
Http://activemq.apache.org/security.html

There are a number of ActiveMQ message Security configuration policies, with simple authorization configuration as an example:
At the end of the broker tag in the Conf/activemq.xml file, add the following content:
$ vim Activemq-01/conf/activemq.xml
<plugins>
<simpleAuthenticationPlugin>
<users>
<authenticationuser username= "Wangziqiang" password= "wangziqiang.123" groups= "Users,admins"/>
</users>
</simpleAuthenticationPlugin>
</plugins>
Defines a Wangziqiang user, the password is wangziqiang.123, the role is Users,admins


Set user name and password for admin:

$ VI Activemq-01/conf/jetty.xml
<bean id= "Securityconstraint" class= "Org.eclipse.jetty.util.security.Constraint" >
<property name= "name" value= "BASIC"/>
<property name= "Roles" value= "admin"/>
<property name= "Authenticate" value= "true"/>
</bean>
Ensure that the value of authenticate is True (default)
The login username password for the console is stored in the Conf/jetty-realm.properties file as follows:
$ VI activemq-01/conf/jetty-realm.properties
# defines users that can access the Web (console, demo, etc.)
# Username:password [, rolename ...]
Admin:wangziqiang, admin

Note: The user name and password are in the format
User name: password, role name
Reboot:
$ activemq-01/bin/activemq Restart

After the reboot, this refresh browser username Admin password Wangziqiang can login


To set the boot boot:
# vim/etc/rc.local
Add the following content
# # ActiveMQ
/ROOT/ACTIVEMQ-01/BIN/ACTIVEMQ start
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.