简体   繁体   English

在不同机器上的IIS中的不同网站上创建应用程序

[英]create application on different web site in IIS on different machine

We are building a asp.net system which is used to publish .net based web service. 我们正在构建一个asp.net系统,用于发布基于.net的Web服务。

It has a simple logic: we have many kinds of web service templates under the App_Data folder. 它有一个简单的逻辑:App_Data文件夹下有很多Web服务模板。

For example,our application url is : http://localhost/serviceManager 例如,我们的应用程序URL为: http://localhost/serviceManager

And this is the folder of our application: 这是我们应用程序的文件夹:

App_Data
   ws1.zip
   ws2.zip
Bin
modules
service
web.config

Note: When this system if first visited ,we will check if the "service" directory is "application" in iis. 注意:如果首次访问此系统,我们将检查iis中的“服务”目录是否为“应用程序”。 If not we will make it. 如果没有,我们会做到的。

Through our system user can fill some required information (especially the service name,for example "test") step by step and we gather them for later use. 通过我们的系统,用户可以逐步填写一些必需的信息(特别是服务名称,例如“测试”),我们收集它们以备后用。

Then we create a folder named test under the service directory,then we find the accordingly web service template(for example ws1.zip),extract is content to the test folder, then we modify the web.config file accordingly information we got. 然后在service目录下创建一个名为test的文件夹,然后找到相应的Web服务模板(例如ws1.zip),将内容提取到test文件夹中,然后相应地修改web.config文件中获得的信息。

At last we set the test as a application in IIS. 最后,我们将test设置为IIS中的application

Now the folders of our application will change like this: 现在,我们的应用程序的文件夹将像这样更改:

App_Data
   ws1.zip
   ws2.zip
Bin
modules
service
  test
    App_Data
    service.asmx
    web.config(filled with gathered information)
web.config

And a new web service is deployed,we can access it use this: 并部署了一个新的Web服务,我们可以使用以下命令访问它:

http://localhost/serviceManager/service/test/service.asmx (note,the service.asmx exist in every template)

This is what we can do so far. 到目前为止,这是我们可以做的。

However the client have further requirements now: 但是,客户现在还有其他要求:

1. separate the manager system from the created service. 1.将管理器系统与创建的服务分开。

Since the client want to map the created service to internet and keep our manager system only on intranet,this is for security. 由于客户希望将创建的服务映射到Internet并将我们的经理系统仅保留在Intranet上,因此这是出于安全性考虑。

As you can see,the created service is put under our manager application. 如您所见,已创建的服务位于我们的经理应用程序下。 We need to deploy them in a different port(in iis,different port means different web site,isn't it?). 我们需要将它们部署在不同的端口中(在iis中,不同的端口意味着不同的网站,不是吗?)。

For example,our application url does not change: http://localhost/serviceManager 例如,我们的应用程序URL不会更改: http://localhost/serviceManager

But the created service will change to something like this: http://localhost:8888/service/test/service.asmx 但是创建的服务将更改为以下内容: http://localhost:8888/service/test/service.asmx

2. implement the cluster(especially for the created service) 2.实施集群(尤其是对于创建的服务)

Since the created services are mass-oriented,so for performance considernation,the client require cluster. 由于创建的服务是面向大众的,因此出于性能考虑,客户端需要集群。

However we do not found anything like weblogic for IIS cluster.So we think the only way it make the copy of the service once it is created and put it in another server (the cluster node) with the same port and virtual context name. 但是我们找不到像IIS群集那样的weblogic东西,因此我们认为唯一的方法是在创建服务后复制服务并将其放置在具有相同端口和虚拟上下文名称的另一台服务器(群集节点)中。

If so we need to create "application" in iis in different machine as my post topic. 如果是这样,我们需要在不同机器的iis中创建“应用程序”作为我的发布主题。

We have no idea now,anyone can give us some suggestion? 我们现在不知道,有人可以给我们一些建议吗?

BTW,we have to support iis6 - iis7.5. 顺便说一句,我们必须支持iis6-iis7.5。

I am the asker of this question. 我是这个问题的追问者。

We have not find a prefect solution by now. 到目前为止,我们还没有找到完美的解决方案。 But we have done some jobs. 但是我们做了一些工作。

Our asp.net application have been packaged as a window installer. 我们的asp.net应用程序已打包为窗口安装程序。 When the application is installed, some necessary jobs would be done: 安装该应用程序后,将完成一些必要的工作:

1 Create two web sites at different port like 8000(for service manager) and 8001(for created services. 1在不同端口创建两个网站,例如8000(用于服务管理器)和8001(用于创建的服务)。

2 Make the root directory of web site of 8001 as windows shared folder. 2将网站8001的根目录设置为Windows共享文件夹。

3 Deploy an iis application named IISManager . 3部署一个名为IISManager的iis应用程序。 This application is a web service which will make a folder under a web site root directory as an IIS application. 该应用程序是一个Web服务,它将在网站根目录下创建一个文件夹作为IIS应用程序。

Now when user access the: 现在,当用户访问以下内容时:

http://ip:8000/servicemanager , and create a service according to the template. http://ip:8000/servicemanager ,然后根据模板创建服务。

We will do the following things: 我们将做以下事情:

1 copy the extracted and configured folder to different cluster nodes by the window shared folders. 1通过窗口共享文件夹将提取并配置的文件夹复制到其他群集节点。

2 call the IISManager service one by one to make the folders at step1 as an IIS application. 2 IISManager调用IISManager服务,使步骤1中的文件夹成为IIS应用程序。

Now if the step successful, we can access the new created service: 现在,如果步骤成功,我们就可以访问新创建的服务:

http://ip:8001/servicename/service.asmx

That's what we have done now. 那就是我们现在所做的。

But we still have a lot of problems: 但是我们仍然有很多问题:

1 The IISManager does not work every time, the iis application creation would be failure sometime. 1 IISManager并非每次都运行,iis应用程序创建有时会失败。

2 The created service at different nodes are completely separate applications, it will be hard to do some session share job. 2在不同节点上创建的服务是完全独立的应用程序,将很难完成某些会话共享工作。

I hope someone have a better solution, 我希望有人有更好的解决方案,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM