本文介绍了创建在IIS中的不同网站,不同机上的应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在建立用来发布基于.NET Web服务的asp.net系统。

它有一个简单的逻辑:我们有许多种Web服务模板App_Data文件夹下的

例如,我们的应用程序的网址是:的http://本地主机/的ServiceManager

这是我们的应用程序的文件夹:

 的App_Data
   ws1.zip
   ws2.zip
箱子
模块
服务
web.config中

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.

At last we set the test as a application in IIS.

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:

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.

Since the client want to map the created service to internet and keep our manager system only on intranet,this is for security.

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?).

For example,our application url does not change: http://localhost/serviceManager

But the created service will change to something like this: http://localhost:8888/service/test/service.asmx

2. implement the cluster(especially for the created service)

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.

If so we need to create "application" in iis in different machine as my post topic.

We have no idea now,anyone can give us some suggestion?

BTW,we have to support 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. 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.

2 Make the root directory of web site of 8001 as windows shared folder.

3 Deploy an iis application named IISManager. This application is a web service which will make a folder under a web site root directory as an IIS application.

Now when user access the:

http://ip:8000/servicemanager, and create a service according to the template.

We will do the following things:

1 copy the extracted and configured folder to different cluster nodes by the window shared folders.

2 call the IISManager service one by one to make the folders at step1 as an IIS application.

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.

2 The created service at different nodes are completely separate applications, it will be hard to do some session share job.

I hope someone have a better solution,

这篇关于创建在IIS中的不同网站,不同机上的应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 04:42
查看更多