How to Run Keystone.js within IIS
2015/7/312 min read
bookmark this
A instruction of how to install node.js keystone at windows 7 IIS as web application.
- Install MongoDB
- Install mongodb as windows service.
- Install Node.js
- keystone.js is running on top of node.js, so you'll need to install node.js for windows.
- Setup keystone.js
- Now it's time to setup keystone web application run by node.js, go to the keystone home page and look throught their instruction or you can do as following.
- open command promt as Administrator and go to the folder where you want to add keystone.js
- type
npm install -g generator-keystone
-
type yo keystone
- above two command you'll setup your keystone.
- open node.js command promt and type
node keystone
- If you can hit localhost:3000 then you're ready to setup keystone.js at IIS with IISnode.
- Install IIS(7 or 8)
- how to install IIS(IIS7 at Windows 10, Windows 8, Windows 7)
- windows + c, open Programs and features as command or go to control panel to open Programs and features.
- Install IISNode
- installed iisnode for iis 7/8 (x64)
- do a test to make sure iisnode installed correctly
- go to /Program Files/iisnode
- click setupsamples.bat, this batch file will tell you how to setup a sample website at IIS by using iisnode.
- Install Url Rewrite module
- Install URL Rewrite 2.0
- Create WebSite at IIS and point to your keystone.js folder
- Add IUser, local login user to have modify permission to all the keystone.js folder
- Add Web.config to root folder or keystone
- this is very important to use node.js, keystone.js at IIS. Following is working web.config you can reference.
-
<configuration> <system.webServer> <handlers> <add name="iisnode" path="keystone.js" verb="*" modules="iisnode" /> </handlers> <rewrite> <rules> <rule name="Catch All"> <match url="/*" /> <action type="Rewrite" url="keystone.js" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
- IIS Bindings
- Now, you can setup IIS bindings, you can map your mydomain.com to this iis website.