gpt4 book ai didi

http - 为什么 Wildfly 不监听 http 端口?

转载 作者:可可西里 更新时间:2023-11-01 16:29:57 26 4
gpt4 key购买 nike

我正在尝试做的事情:

我想在 Ubuntu 上运行 Wildfly(作为 Oracle VM)。

问题:

我最近发现它停止监听 http 端口。以下内容有望证明 Wildfly 正在运行并配置为监听 8080。但是,此端口上没有任何监听:

polly@polly-VirtualBox:/opt/wildfly/bin$ ./jboss-cli.sh
Listening for transport dt_socket at address: 8787
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /] connect
[standalone@localhost:9990 /] [standalone@localhost:9990 /] /socket-binding-group=standard-sockets/socket-binding=http:read-resource
{
"outcome" => "success",
"result" => {
"client-mappings" => undefined,
"fixed-port" => false,
"interface" => undefined,
"multicast-address" => undefined,
"multicast-port" => undefined,
"name" => "http",
"port" => expression "${jboss.http.port:8080}"
}
}

polly@polly-VirtualBox:~$ sudo netstat -pl | grep 8080
polly@polly-VirtualBox:~$ sudo netstat -pl | grep 9990
tcp 0 0 localhost:9990 *:* LISTEN 1106/java
polly@polly-VirtualBox:~$ ps -ef | grep 1106
polly 1106 1036 2 09:18 ? 00:00:05 java -D[Standalone] -server -Xms64m -Xmx512m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Dorg.jboss.boot.log.file=/opt/wildfly/standalone/log/server.log -Dlogging.configuration=file:/opt/wildfly/standalone/configuration/logging.properties -jar /opt/wildfly/jboss-modules.jar -mp /opt/wildfly/modules org.jboss.as.standalone -Djboss.home.dir=/opt/wildfly -Djboss.server.base.dir=/opt/wildfly/standalone -c standalone.xml
polly 2477 2384 0 09:22 pts/0 00:00:00 grep --color=auto 1106

我尝试过的:

抵消端口似乎毫无意义,因为据我所知,8080 实际上是免费的,但我还是试过了(无济于事):

polly@polly-VirtualBox:/opt/wildfly/bin$ sudo netstat -pl | grep 8180
polly@polly-VirtualBox:/opt/wildfly/bin$ sudo netstat -pl | grep 10090
tcp 0 0 localhost:10090 *:* LISTEN 3165/java
polly@polly-VirtualBox:/opt/wildfly/bin$ curl -X GET http://localhost:10090/console/App.html
<!DOCTYPE html>
<html>
<head>
<title>Management Interface</title>
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<script type="text/javascript" language="javascript" src="app/app.nocache.js"></script>
<link rel="shortcut icon" href="/console/images/favicon.ico" />
</head>
<body>

<!-- history iframe required on IE -->
<iframe src="javascript:''" id="__gwt_historyFrame" style="width:0px;height:0px;border:0px"></iframe>

<!-- pre load images-->
<div style="visibility:hidden"><img src="images/loading_lite.gif"/></div>
</body>
</html>
polly@polly-VirtualBox:/opt/wildfly/bin$ curl -X GET http://localhost:8180
curl: (7) Failed to connect to localhost port 8180: Connection refused

我也尝试研究日志(下面的链接),但我看不到任何明显的问题。

我的问题:

为什么 Wildfly 没有监听 http 端口?任何我接下来可以尝试的建议都将不胜感激。

日志

https://1drv.ms/f/s!Ao4w10eVqKCjbLJ3OQdiy_WH9Q8

最佳答案

在浏览您的 standalone.xml 时,我看到您对它进行了很多修改。例如,与默认的 standalone.xml 相比,您删除了整个配置文件部分。要使 Web 服务器正常工作,您至少需要 Undertow。

所以至少,你需要添加:

<profile>

<subsystem xmlns="urn:jboss:domain:io:1.1">
<worker name="default"/>
<buffer-pool name="default"/>
</subsystem>

<subsystem xmlns="urn:jboss:domain:undertow:3.0">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="default" socket-binding="http" redirect-socket="https"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
</host>
</server>
<servlet-container name="default">
<jsp-config/>
<websockets/>
</servlet-container>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
</handlers>
<filters>
<response-header name="server-header" header-name="Server" header-value="WildFly/10"/>
<response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
</filters>
</subsystem>

</profile>

关于http - 为什么 Wildfly 不监听 http 端口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38142186/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com