简体   繁体   中英

cant connect to activemq web console deployed in wsl2 ubuntu 22.04 from windows 11

I'm trying to use activemq 5.17.3 in windows 11 wsl2 ubuntu 22.04. However I cant connect to localhost:8161, 127.0.0.1:8161, http://172.30.192.1:8161 (ipv4 address of wsl). All of them giving me response connection refused. I already turn off windows defender firewall, but the problem isnt solved yet.

Im also using docker in wsl. If I access service from the docker containers, i can connect without problem. same thing when I run php artisan serve to run laravel project in wsl, I can connect too but only using url 127.0.0.1.

Please help me. I will gladly update the question with requested details you needed to answer the question. Sorry for the bad english. Thank you.

activemq accessed using curl activemq accessed using curl

activemq web activemq web

activemq console web

run laravel project in wsl run laravel project in wsl

laravel web laravel web

run kibana run kibana

web kibana web kibana

The solution is:

for activemq classic:

inside the $ACTIVEMQ_HOME directory, there is conf/jetty.xml. change the host from to 0.0.0.0

<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>

for activemq artemis:

inside the $ARTEMIS_INSTANCE_HOME directory, there is etc/bootstrap.xml. change the web binding host to 0.0.0.0

<!-- The web server is only bound to localhost by default -->
<web path="web" rootRedirectLocation="console">
   <binding uri="http://0.0.0.0:8161">
       <app url="activemq-branding" war="activemq-branding.war"/>
       <app url="artemis-plugin" war="artemis-plugin.war"/>
       <app url="console" war="console.war"/>
   </binding>
</web>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM