最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

如何确定为什么我得到我的node.js服务器上的503错误?

IT培训 admin 3浏览 0评论

如何确定为什么我得到我的node.js服务器上的503错误?

我目前正在自学的Node.js作为一个业余爱好者。我有我以前能得到与简单的“世界你好”输出工作的服务器。不过,我想我可能有破东西在我的node.js服务器,同时做一些上周修修补补,它不再起作用。不幸的是,我不知道如何解决的答案,我希望在这个方向。

问题是,当我浏览到我的域名我只是得到一个503错误。

然而,当我检查我的node.js日志文件,输出显示服务器正在运行我的默认文本。

我使用的示例代码:

    // Load the http module to create an http server.
var http = require('http'),
    sys = require('sys');

// Configure our HTTP server to respond with Hello World to all requests.
var server = http.createServer(function (request, response) {
  response.writeHead(200, {"Content-Type": "text/plain"});
  response.end("Hello World\n");
});

// Listen on port 8000, IP defaults to 127.0.0.1
server.listen(8000);

// Put a friendly message in the log
sys.puts("Server running on port 8000");

谁能帮助我发现找到为什么我得到一个503更详细原因的地方吗?

我看了看Apache的错误日志和看到这一点,但不知道这意味着什么:

[Fri May 30 18:12:09.658627 2014] [proxy:error] [pid 25351:tid 3071591036672] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:8080 (127.0.0.1) failed
[Fri May 30 18:12:09.658713 2014] [proxy:error] [pid 25351:tid 3071591036672] AH00959: ap_proxy_connect_backend disabling worker for (127.0.0.1) for 60s
[Fri May 30 18:12:09.658731 2014] [proxy_http:error] [pid 25351:tid 3071591036672] [client 128.32.70.98:19556] AH01114: HTTP: failed to make connection to backend: 127.0.0.1
[Fri May 30 18:12:10.096354 2014] [proxy:error] [pid 25351:tid 3071599429376] AH00940: HTTP: disabled connection for (127.0.0.1)
回答如下:

看起来像你的node.js配置为侦听端口8000

server.listen(8000);

但是Apache尝试连接到端口8080

HTTP: attempt to connect to 127.0.0.1:8080 (127.0.0.1) failed
                                        ^

同时配置应用程序使用同一端口(并确保它尚未使用)。

如何确定为什么我得到我的node.js服务器上的503错误?

我目前正在自学的Node.js作为一个业余爱好者。我有我以前能得到与简单的“世界你好”输出工作的服务器。不过,我想我可能有破东西在我的node.js服务器,同时做一些上周修修补补,它不再起作用。不幸的是,我不知道如何解决的答案,我希望在这个方向。

问题是,当我浏览到我的域名我只是得到一个503错误。

然而,当我检查我的node.js日志文件,输出显示服务器正在运行我的默认文本。

我使用的示例代码:

    // Load the http module to create an http server.
var http = require('http'),
    sys = require('sys');

// Configure our HTTP server to respond with Hello World to all requests.
var server = http.createServer(function (request, response) {
  response.writeHead(200, {"Content-Type": "text/plain"});
  response.end("Hello World\n");
});

// Listen on port 8000, IP defaults to 127.0.0.1
server.listen(8000);

// Put a friendly message in the log
sys.puts("Server running on port 8000");

谁能帮助我发现找到为什么我得到一个503更详细原因的地方吗?

我看了看Apache的错误日志和看到这一点,但不知道这意味着什么:

[Fri May 30 18:12:09.658627 2014] [proxy:error] [pid 25351:tid 3071591036672] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:8080 (127.0.0.1) failed
[Fri May 30 18:12:09.658713 2014] [proxy:error] [pid 25351:tid 3071591036672] AH00959: ap_proxy_connect_backend disabling worker for (127.0.0.1) for 60s
[Fri May 30 18:12:09.658731 2014] [proxy_http:error] [pid 25351:tid 3071591036672] [client 128.32.70.98:19556] AH01114: HTTP: failed to make connection to backend: 127.0.0.1
[Fri May 30 18:12:10.096354 2014] [proxy:error] [pid 25351:tid 3071599429376] AH00940: HTTP: disabled connection for (127.0.0.1)
回答如下:

看起来像你的node.js配置为侦听端口8000

server.listen(8000);

但是Apache尝试连接到端口8080

HTTP: attempt to connect to 127.0.0.1:8080 (127.0.0.1) failed
                                        ^

同时配置应用程序使用同一端口(并确保它尚未使用)。

发布评论

评论列表 (0)

  1. 暂无评论