這可能是一個非常簡單的問題,但我可以在IIS的Windows Server 2008環境中使用node.js嗎?有沒有「微軟」圖書館或其他更好的解決方案?你可以在IIS中使用node.js嗎?
回答
演練的設置Windows + IIS +的Node.js + MongoDB中構建一個快速待辦事項應用
http://www.amazedsaint.com/2011/09/creating-10-minute-todo-listing-app-on.html
您可以在Windows上安裝Node.js的,但它是它自己的服務器,所以除非你正在使用IIS作爲代理它,就沒有必要對IIS的。請注意,從Node.js's installation instructions引用以下內容:
兩個[Windows]版本都不令人滿意穩定,但可以運行某些東西。
我一直在使用的Windows節點與Cygwin和有一些問題。您可以使用IIS在默認端口80上運行,並在不同端口上運行Node應用程序。
如果你想代理,那麼大多數都使用Nginx。
可以在Windows build node.js的,但不建議使用它由於可能的穩定性問題。如果IIS使用基於線程的池,那麼對於node.js,您甚至不應該將它用作reverse proxy(在基於Linux的系統上nginx通常用於執行此操作),因爲池可能會很快完全加載。如果你想在窗口上使用類似node.js的東西,那麼你應該嘗試看看manos。
當然你可以檢查出IISNode Project。
有一些這方面的好文章現在:
Installing and Running node.js applications within IIS on Windows - Are you mad?
Hosting node.js applications in IIS on Windows
...甚至是GitHub的項目,一些樣品:
https://github.com/tjanczuk/iisnode/tree/master/src/samples
https://github.com/tjanczuk/iisnode
第一鏈接被打破 – 2016-12-06 13:38:13
實際上需要運行通過IIS使Node.js應用兩條路線。
如果您正在致力於整個應用程序的Node.js和只需要面向公衆的端點通過現有的IIS應用程序的工作,我會建議使用ARR通過路由整個網站。我爲幾個項目做了這個,並且它工作得很好。
說實話,我並不喜歡IISNode,因爲它好像你在你的節點代碼與IIS使外國人端點。它有效,如果你特別針對Azure,它可能是你最好的選擇。如果您需要將它放入現有的.Net應用程序中,它也可能是最好的選擇。
我想讓它儘可能簡單。
與iisnode問題
我安裝iisnode跑沒有問題,我試着用iisnode部署在IIS上的樣品,但...
,但我不得不捆綁我的流星應用程序,然後將其作爲節點應用程序部署。我遇到的問題使我感到灰心。我不能讓
fibers
安裝在所有。編譯過程中不斷出現錯誤,所以我放棄了。
反向代理IIS
我做了什麼來解決這個對我來說是使用IIS上的反向代理。
我最後的web.config項是:
我也一樣,但是,我對IIS反向代理使用 方式對域名的子文件夾丟給我的。
我不知道,通過使用ROOT_URL我們可以指定一個子 路徑。
例如,如果我跑我的流星的應用程序文件夾中的以下命令:
set ROOT_URL=http://localhost:3100/n/todos && meteor
我將能夠
http://localhost:3100/n/todos
訪問我的應用程序, 通知我省略了結尾/
。如果我們試圖瀏覽到 地址http://localhost:3100/n
或http://localhost:3100/
將 給我們一個錯誤Unknown path
。所以,當我第一次設置反向代理,我每次得到
Unknown Path
錯誤。原來,在我的IIS的配置,我必須指定
http://localhost:3100/n/todos
作爲操作的URL值,請 通知「N /待辦事項」結尾。所以我重寫規則弄成這個樣子:[文件@ C:/inetpub/wwroot/web.config]
``` <configuration> <system.webServer> <rewrite> <rules> <rule name="TODOs meteor app. Route the requests" stopProcessing="true" enabled="true"> <match url="^n/todos/(.*)" /> <conditions> <add input="{CACHE_URL}" pattern="^(https?)://" /> </conditions> <action type="Rewrite" url="{C:1}://localhost:3100/n/todos/{R:1}" /> <!-- I was missing the /n/todos here --> <serverVariables> <set name="HTTP_ACCEPT_ENCODING" value="" /> </serverVariables> </rule> </rules> <outboundRules> <rule name="TODOs ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1" enabled="false"> <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^http(s)?://localhost:3100/(.*)" /> <action type="Rewrite" value="/n/todos/{R:2}" /> </rule> <rule name="TODOs RewriteRelativePaths" preCondition="ResponseIsHtml1" enabled="false"> <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^/(.*)" negate="false" /> <action type="Rewrite" value="/n/todos/{R:1}" /> </rule> <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1"> <match filterByTags="A, Form, Img" pattern="^http(s)?://localhost:3100/(.*)" /> <action type="Rewrite" value="http{R:1}://localhost/{R:2}" /> </rule> <preConditions> <preCondition name="ResponseIsHtml1"> <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /> </preCondition> </preConditions> </outboundRules> </rewrite> </system.webServer> </configuration> ```
感謝
- 1. 你可以在DataTemplate中使用CollectionViewSource嗎?
- 2. 你可以在RCloud中使用LaTex嗎?
- 3. 你可以在sessionStorage中使用jQuery嗎?
- 4. 你可以在Gitlab中使用word_diff嗎?
- 5. 你可以在ListBox.SelectedItems上使用ValidationRules嗎?
- 6. 你可以在android上使用GSUtil嗎?
- 7. 你可以在使用塊嗎?
- 8. 你可以在Eclipse中禁用DDMS嗎
- 9. 你可以使用cocoapods安裝GeoFire嗎?
- 10. 你可以使用Lucene作爲OODB嗎?
- 11. 你可以使用Ninject 2的AOP嗎?
- 12. 你可以免費使用EGit嗎?
- 13. 你可以使用RSpec,Shoulda,RCov嗎?
- 14. 你可以使你的UI功能可重用嗎?
- 15. 你可以在C#中使用通用表單嗎?
- 16. 你可以在Dart應用程序中使用Java庫嗎?
- 17. 你可以在應用中使用Apple Watch Crown嗎?
- 18. 你可以在Silverlight中使用多個應用程序域嗎?
- 19. 你可以在UWP中的C#代碼中使用C++ DLL嗎?
- 20. 你可以用Future.cancel(true)中斷BufferedReader.readLine()嗎?
- 21. 我可以在webpack中使用node.js服務器模塊嗎?
- 22. 我可以在Meteor中使用其他node.js庫嗎?
- 23. 你可以在GridView中縮進嗎?
- 24. 你可以在Linux中運行Xcode嗎?
- 25. 你可以在javascript中解釋「this」嗎?
- 26. 你可以在PHP中嵌套類嗎?
- 27. 你可以在LaTeX中迭代嗎?
- 28. SqlProfileProvider - 你可以在項目中使用Profile.GetProfile()嗎?
- 29. 你可以在CSS中使用if/else條件嗎?
- 30. CakePHP:你可以在頁面中使用管理員前綴嗎?
涼爽。是否有類似於iis的內容? – 2011-04-05 02:26:10
不知道,但我對此表示懷疑。 – 2011-04-05 03:50:00