如何在 CentOS 6.5 上远程访问 ActiveMQ?

如何在 CentOS 6.5 上远程访问 ActiveMQ?

我尝试使用以下代码:

iptables -A INPUT -m state --state NEW -m tcp -p tcp \
  --dport 8161 -j ACCEPT -m comment \
  --comment "ActiveMq Server port"

我仍然无法远程访问它。

该进程在本地运行,ss -tulpan | grep 8161显示:

tcp LISTEN 0 50 :::8161 :::* users:(("java",8261,131))

现行iptables规则如下:

# iptables -nvL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination                                                                             
 7773 9649K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0                                                                                                                                                                        state RELATED,ESTABLISHED
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0                                                                                                                                                                
    9   540 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0                                                                                                                                                                
    2   828 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0                                                                                                                                                                        state NEW tcp dpt:22
  503 44938 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0                                                                                                                                                                        reject-with icmp-host-prohibited
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0                                                                                                                                                                        state NEW tcp dpt:8161 /* ActiveMq Server port */

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination                                                                                                                                                              
    0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0                                                                                                                                                                        reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT 4856 packets, 760K bytes)
 pkts bytes target     prot opt in     out     source               destination

相关内容