在IIS虚拟目录设置上运行nodejs/MEAN应用 [英] Running nodejs/MEAN app on IIS virtual directory setup

查看:62
本文介绍了在IIS虚拟目录设置上运行nodejs/MEAN应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows上运行我的MEAN应用.到目前为止,我已经在非吸吮服务管理器上作为Windows服务运行该应用程序.现在,我们需要启用Windows身份验证,并且我们计划使用IIS.

I am running my MEAN app on windows. So far I was running the application on Non-Sucking Service Manager as a windows service. Now we need to enable windows authetication and we are planning to use IIS.

我们计划为此使用 IISNode .到目前为止,我已经阅读了此帖子.

We are planning to use IISNode for this. So far I have read this post.

我通过运行 setupsamples.bat 文件安装了IISNode附带的示例.运行此文件通常会创建一个虚拟目录@ C:\ Program Files \ iisnode \ www

I installed the samples that comes with IISNode by running setupsamples.bat file. running this file typically creates a virtual directory @ C:\Program Files\iisnode\www

我想了解如果我需要运行我的应用程序,是否总是需要复制 C:\ Program Files \ iisnode \ www 文件夹下的所有内容?或者我可以创建一个新的虚拟目录并使它工作?

I want to understand If I need to run my application, Do I always need to copy all the content under C:\Program Files\iisnode\www folder? Or I can create a new virtual directory and make it work ?

推荐答案

我回答了与此类似的问题

I answered a similar question to this here

IISNode允许您像操作IIS中的任何其他应用程序一样操作Node.js应用程序.只要确保您具有IISNode,Node.js和网址重写模块已安装在环境中,并已为您的应用程序安装了Web.config,您应该一切顺利.如果没有URL重写模块,则必须转到 http://host:port/app.js/代替 http://host:port ,IISNode便利用它来完成此任务.

IISNode allows you operate your Node.js app just like you would any other application in IIS. Just make sure you have IISNode, Node.js, and the Url Re-write Module installed on the environment as well as a Web.config for your app and you should be good to go. Without the URL Re-write module then you would have to go to http://host:port/app.js/ instead of http://host:port and IISNode takes advantage of it to accomplish this.

在该线程中,我有一个模板Web.config,可与所有IISNode服务/Web应用程序一起使用.它将支持在IIS中进行托管的所有方面,包括在虚拟目录中托管您的应用程序.只要确保您的应用程序的主文件与"URL重写"部分中的配置文件中引用的主文件相匹配即可.

In that thread I have a template Web.config that I use with all my IISNode services/web apps. It will support all aspects of hosting in IIS, including hosting your app in a Virtual Directory. Just make sure that the main file for your app matches the main file referenced in the config file within the URL Re-writing section.

如果您使用的是VS,则建议下载 Visual Studio的Node.js工具.它有助于创建IISNode所需的Web.config.

If you are using VS then I recommend downloading the Node.js Tools for Visual Studio. It helps with creating the Web.config that you need for IISNode.

这篇关于在IIS虚拟目录设置上运行nodejs/MEAN应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆