2013-06-13 5 views
4

Windows Azure 웹 사이트에서 nodeJS 사이트를 실행하려고합니다.Azure 웹 사이트에서 nodeJS 사이트 실행

server.js package.json

그리고 npm install에서 내 모든 모듈 : 난 그냥 자식이 두 파일을 밀었다. 그것은 로컬 잘 작동하지만 난 WA 웹 사이트를 탐색 할 때 난 그냥 얻을 :

The page cannot be displayed because an internal server error has occurred.

내가 꼬리 로그를 얻을 수있는 CLI를 사용하지만, 난 그냥이 참조 : 실제를 보지 않고

<h3>HTTP Error 500.0 - Internal Server Error</h3> 
<h4>The page cannot be displayed because an internal server error has occurred.</h4> 
</div> 
<div class="content-container"> 
<fieldset><h4>Most likely causes:</h4> 
<ul> <li>IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.</li> <li>IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.</li> <li>IIS was not able to process configuration for the Web site or application.</li>  <li>The authenticated user does not have permission to use this DLL.</li> <li>The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.</li> </ul> 
</fieldset> 
</div> 
<div class="content-container"> 
<fieldset><h4>Things you can try:</h4> 
<ul> <li>Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account.</li>  <li>Check the event logs to see if any additional information was logged.</li> <li>Verify the permissions for the DLL.</li> <li>Install the .NET Extensibility feature if the request is mapped to a managed handler.</li> <li>Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click <a href="http://go.microsoft.com/fwlink/?LinkID=66439">here</a>. </li> </ul> 

답변

13

을 server.js 코드 (질문에 삽입해야 함)를 사용하면 문제의 원인을 추측 할 수 있습니다. 그래서 ... 제 추측으로는 server.js가 올바른 포트에서 수신하지 않는 것입니다 (물론 틀릴 ​​수도 있습니다 ...). Node.js를 개발자 섹션에서 WindowsAzure.com 사이트하여 node.js tutorial에서

, 당신은 환경에서 포트를 잡아해야하는 방법을 보여줍니다 "안녕하세요"예를있다 :

var http = require('http') 
var port = process.env.PORT || 1337; 
http.createServer(function(req, res) { 
    res.writeHead(200, { 'Content-Type': 'text/plain' }); 
    res.end('Hello World\n'); 
}).listen(port); 

당신 서버가 포트 80에서 수신 대기 할 수 없습니다. 올바른 포트를 가져와 process.env.PORT에서 가져와야합니다.

잘하면이 문제가 ...

+0

매력처럼 작동합니다. – codelovesme