Search code examples
node.jsiisiisnode

iisnode on windows 7 IIS 7.5 throwing 500.19 error


I have followed the steps mentioned on this github page. But even after doing everything as mentioned I am constantly getting an internal server error while trying to run the sample applications that is installed by the setupsamples.bat file which come with issnode package.

I have attached the screen shots and the related code file.

The issnode home page seems to work fine

Hello world crashes

Here is the hello.js file

var http = require('http');

http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/html'});
    res.end('Hello, world! [helloworld sample; iisnode version is ' +     process.env.IISNODE_VERSION + ', node version is ' + process.version + ']');
}).listen(process.env.PORT);  

And the web.config file

<configuration>
   <system.webServer>

    <!-- indicates that the hello.js file is a node.js application 
    to be handled by the iisnode module -->

    <handlers>
      <add name="iisnode" path="hello.js" verb="*" modules="iisnode" />
    </handlers>

  </system.webServer>
</configuration>

Solution

  • This is because you have a configuration at the server level that isn't overridable on the site level. Since you are adding a handler, I assume that it is the handler configuration that needs to be unlocked. You should be able to do that from the iis configuration program, or you can use the appcmd to unlock it.

    You can read more about it here: http://www.iis.net/learn/get-started/planning-for-security/how-to-use-locking-in-iis-configuration

    http://www.tomdupont.net/2012/10/how-to-unlock-configuration-section.html