Can browse to localhost, but not to hostname or ip

I installed AcitveMQ in a LXD container. I can curl to local host from within the LXD container

[root@centos8 activemq]# curl http://localhost:8161

Error 401 Unauthorized

HTTP ERROR 401 Unauthorized

URI: /
MESSAGE: Unauthorized

Powered by Jetty:// 9.4.39.v20210325

But I can not connect to its ip.

[root@centos8 activemq]# curl
curl: (7) Failed to connect to port 8161: Connection refused

I can not curl to it from the host either

Karl@Nordström ~:$ curl
curl: (7) Failed to connect to port 8161: Connection refused

Karl@Nordström ~:$ lxc list centos8
| centos8 | RUNNING | (eth0) | | CONTAINER | 0 |

firewalld, iptables and nftables are not installed.

Does CentOS 8 block some network traffic by default?

It could be firewalling or it could be that ActiveMQ out of the box only listens on the localhost address and that you need to configure it to listen on something else (like or :: for all addresses).

Running something like ss -tlpn inside the container will show you if the service is listening on an external address.

I changed the host name value in a jetty.xml file from to

[root@centos8 activemq]# less /opt/local/activemq/conf/jetty.xml

<bean id="jettyPort" class="org.apache.activemq.web.WebConsolePort" init-method="start">
         <!-- the default port number for the web console -->
    <property name="host" value=""/>
    <property name="port" value="8161"/>

to match our dev host.

[kxn2@amq-d01 ~]$ less /opt/local/activemq/conf/jetty.xml

and restart activemq service and now it works.

Thanks for your help

1 Like

before my config change

LISTEN 0 50 [::ffff:]:8161

after my change

LISTEN 0 50 *:8161