user402186
user402186

Reputation: 489

Seperate ASP Application for each client on IIS or Single?

Hi Developers/Architects,

This is more of an Architectural question:

I have a web application. The application use ASP Membership API (froms authentication) for users/roles management.

We host a separate application for each of our clients. So basically each client has an Application Name in ASP Membership database. That client then create his roles/users according to his need.

The reason why we have same website, hosted on IIS for each client separately under client name's virtual directory, is because all of the clients have their separate Application Name (in terms of ASP Membership), and the underlying database is separate for each client as well.

so each client has a separate URL, e.g: http://mysite/client1. and then client1 has his own users, roles. The underlying application database used by application is clients individual.

The Web Application and the database schema is exactly same for all clients.

I can not take any decision regarding the database part. So i am not going to discuss that.

But i want to change the approach of hosting separate application for each client. I want to host one application for all clients:

this brings some questions:

Q1. how would i create these urls: http://mysite/client1, http://mysite/client2 (as i can not put names of all clients on the main login page, and then once user selects the client name, provides username/password .... i can not do that due to the nature of the business)*

Q2. I can not create single application (on IIS and on ASP Membership level) and then separate clients by roles, because all clients have roles within themselves, and plus, 2 or more clients can have a user by same name; so userX for client1 and userX for client2. theses users are different, but they happen to have same names.

* One solution to Q1 can be: that i create a new forwarder application, which is hosted for each client separately in IIS under client's virtual directory. And when client opens their url (e.g: http://mysiteforworder/client1) they are redirected to (http://mysite/Default.apsx?app=hjuk98jkio8) where (hjuk98jkio8) is a encrypted name of the client, that we use internally.

this would resolve Q1, but not Q2.

let me know what options do I have ...

Upvotes: 0

Views: 196

Answers (1)

Kieren Johnstone
Kieren Johnstone

Reputation: 42003

Here's an idea I've used a few times before.

You can set up multiple Web Applications / Virtual Directories in IIS, e.g. /client1 and /client2, that point to the same physical web application path on disk. That way the code is still the same for all customers, all managed centrally, but there are different URLs for different customers.

Using WMI you can even script or automate creation/maintenance of the webapps/vdirs in IIS.

To determine which DB to connect to, or which app is running, you can look at the URL being accessed and use the first part of the path as a key into a configuration dictionary for that customer.

Upvotes: 1

Related Questions