简体   繁体   English

无法连接到部署在 wsl2 ubuntu 22.04 中的 activemq web 控制台,来自 windows 11

[英]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.我正在尝试在 windows 11 wsl2 ubuntu 22.04 中使用 activemq 5.17.3。 However I cant connect to localhost:8161, 127.0.0.1:8161, http://172.30.192.1:8161 (ipv4 address of wsl).但是我无法连接到 localhost: 8161、127.0.0.1:8161、http://172.30.192.1:8161 (wsl 的 ipv4 地址)。 All of them giving me response connection refused.所有给我回应的人都被拒绝了。 I already turn off windows defender firewall, but the problem isnt solved yet. windows defender 防火墙我已经关闭了,但是问题还没有解决。

Im also using docker in wsl.我还在 wsl 中使用 docker。 If I access service from the docker containers, i can connect without problem.如果我从 docker 容器访问服务,我可以毫无问题地连接。 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.当我运行php artisan serve在 wsl 中运行 laravel 项目时,我也可以连接,但只能使用 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使用 curl 访问的 activemq 使用 curl访问的 activemq

activemq web activemq web activemq web activemq web

activemq console web activemq 控制台 web

run laravel project in wsl run laravel project in wsl在 wsl 中运行 laravel 项目 在 wsl 中运行 laravel 项目

laravel web laravel web laravel web laravel web

run kibana run kibana运行 kibana运行 kibana

web kibana web kibana web 基巴纳web 基巴纳

The solution is:解决办法是:

for activemq classic:对于 activemq 经典:

inside the $ACTIVEMQ_HOME directory, there is conf/jetty.xml.在 $ACTIVEMQ_HOME 目录中,有 conf/jetty.xml。 change the host from to 0.0.0.0将主机从更改为 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:对于 activemq artemis:

inside the $ARTEMIS_INSTANCE_HOME directory, there is etc/bootstrap.xml.在 $ARTEMIS_INSTANCE_HOME 目录中,有 etc/bootstrap.xml。 change the web binding host to 0.0.0.0将 web 绑定主机更改为 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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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