Nodejs long ago wanted to play, but has not time, last night spent 4 hours to the IIS on the erection of success, nonsense not to say.
PS: My system is windows8.1 x64, so it comes with iis8.5 , and the downloaded file is x64 .
The most: Download file
Nodejs http://www.nodejs.org/download/
Iisnode https://github.com/tjanczuk/iisnode/wiki/iisnode-releases
IIS URL Rewrite Http://www.iis.net/downloads/microsoft/url-rewrite
No.2: Installation
Ok, file download OK The next step is to install, but win8.1 installation process MSI installation package error code is 2503 error, find half a day do not know why, but there is a solution on the Internet
Solution: http://jingyan.baidu.com/article/a501d80cec07daec630f5e18.html
Simple meaning is to run cmd as an administrator, and then navigate to your *.msi folder in cmd enter the program name (*.msi) installation is OK.
Nodejs need to select the folder during the installation process, the other direct next to do, of course, you agree to the premise of the agreement.
No.3: Configuring
3 files After the installation is complete, the administrator run cmd, input node-v will appear Nodejs version, the input nmp-v will appear the version of NMP, (I do not know what the NMP did, the first day of contact).
The version number that appears indicates that you are half successful, and you are now starting to configure the environment. Http://www.cnblogs.com/linjiqin/p/3765390.html this blog is my reference, beginners
Navigate to the Nodejs folder and enter the following command (one line at a time, I only use these two commands.) )
NPM Install Express-g NPM Install jade-g
Here Nodejs environment is done, the rest is to go with IIS.
No.4: Tinkering with IIS
So open IIS I will not say, I go to enable, will not Baidu, below to a few tutorial address:
Http://www.3lian.com/edu/2013/06-03/72616.html
Http://jingyan.baidu.com/article/ea24bc39ae3de8da62b331ce.html
The IIS selections are all checked. Of course, a lot is useless.
Next look at the picture operation process:
The Ok,iis mapping has been completed and the next step is to create a small test page.
Find a folder as the root directory of the site: Inside Create a serve folder folder inside put a JS file name arbitrary file content:
var http = require (' http '); Http.createserver (function (req, res) {
Res.writehead (200, {
}). Listen (Process.env.PORT);
And then directly use the browser to access the file on the test site you built. My http://127.0.0.1/serve/s.js.
You can see the output of a classic Hello world.
I also began to contact Nodejs, big god do not touch, novice not worship.
Nodejs Beginner ———— Installation (iis8.5+windows8.1)