Can you create folders to organize web sites in IIS7? - asp.net

I have several ASP.NET sites in IIS7 and would like to be able to group them into folders (or other mechanism, if available). Ideally, I would use a customer name or account number and put the sites under there.
Is there a way to customize the organization of sites in IIS7, or is there just the one 'flat' view?
I'm open to tricks and hacks.

IIS7 (or any other version) does not have the concept of folders for sites. I would instead come up with a naming scheme that, on sorting the list of sites, makes it easier to find what you need.

One option will be to add multiple applications under one site if they are related and on same domain of course. You can also have each applicatoin associates to its own application pool.
For example,
www.example.com
www.example.com/admin
www.example.com/auth

Related

Host Four ASP.Net Projects in IIS as single direcory(maintain more projects in same url)

I m having a ASP.Net Webapplication it accessed by from many geography like India,China&America.In that application's login page fields are username,Password & Geography.
Based on this login page geography option the application's functionalities will change in all page.
In this project,If we add a feature for Indian users but that will not required for other geography users,So we use some conditions like if The geography is India means Enable the feature others means disable it.
problem here it is, in all pages we need to use so many conditions check,some time it creates conditions check overhead.
So we planing for divide the webappplication in to separate applications based on geography wise.
What I planing is,
In hosting environment
1.Keep the same project into Three(India,China,America) Subdirectories.
2.In root directory we have login page only .So once user select the geography means we need to redirect the corresponding subdirectory.
By this way we can maintain the changes which made based geography as separate.
But My doubt is...
If we keep the project as Three(India,China,America) Subdirectories means each directories are have same files ,bin and webconfig file,So I think we cant maintain more than one webconfig file in hosted ASP.Net application folder.
This Subdirectories idea is possible or not in IIS hosting environment?
Is any other options are available?
Experts please share your valuable ideas.
Thanks in Advance
Ramesh
Good afternoon Ramesh!
If I understand your question correctly you currently have 3 separate web roots and you want to use these as separate web applications that will be served to users based on geography in some way. You also want to maintain individual web configuration files for each as well. If this is your inquiry then this set-up is definitely possible within IIS 7 and above.
To provide this functionality this you can do the following:
Configure a single main site within the IIS. This site can point to a web root or nothing. If it points to a web root, whatever web.config that exists will be inherited by the web applications we will add in the next few steps. Otherwise, the machine.config will be used.
Add 3 separate web applications underneath this main site. Make sure to add the root path of each application to use the respective 3 paths for your web roots. The web applications will by default inherit web configurations from the main site as mentioned earlier, but you can include a separate web.config within each of these web root folders.

How do i scale my solution to multiple domains on single web application

Im a little lost here. Im starting on a project for a customer who wants a SaaS solution as a small portal.
The idea is that i make a web solution e.g. an online business card, where each customer should have their own domain like this:
www.carpenter.com
www.painter.com
www.masonry.com
Etc. each of these domains should point to my web application and each have their own administration web site and the online business card. This means that if I go to: www.carpenter.com I should see the companys online business card. And at the url: www.carpenter.com/admin the carpenter company should be able to log in and edit its information.
I hope this makes sense.
What Im looking at is how this is done in practice, I would like to have a central database and a central place to update my software (maybe one per country). What do i need to do to point a www.carpenter.com domain/url to its own specific area in my web app. And how do I need to structure my web application to do this?
Im using ASP.NET MVC for this, but this should be a general question regardless of language - or?
Im considering using a cloud service such as Azure, is this possible with this setup? Or do i need a virtual hosted server i own myself?
I guess the main question is "how do I host multiple domains on the same software" - and keep the display of the "business card" and admin separated from each customer?
Not sure if this specifically answers your question, and my experience thus far has not been with ASP, but I think the general idea is that you determine the execution environment for your web app early in the bootstrap process, and then set constants and configuration options at that point. Then, you can use those values throughout your application to customise the response based on which site you're working with (i.e. carpetner, masonry, etc.). And, since the only piece of differentiating information you have during the bootstrap process is the domain name and URL of the site being requested, I think the generally accepted method is to switch on the domain name. So, you can store different configs for the different sites based on their domain names, and then load those configs during the bootstrap process. For example, if you had a different site template for your carpentry site and your masonry site, you could store the path to your templates as one of the configuration options. HTH

Can I Have Multiple ASP.Net Web Sites in Same Solution?

I have a website out there that I seem to keep wanting to add totally new things to each year. So when I go to www.MySite.com it does essentially one thing. So when I have a new idea for what is technically a totally different site, I do not want to have to come up with and then purchase a new domain name and hosting plan. I see in my hosting companies control panel that I can have multiple "application starting points." I have also read a bit about URL Rewriting. Not to mention, there is the setting of Virtual Path which I found when researching (Running aspnet web site starts on parent directory)
So my desire would be to have perhaps on solution with many projects (Web Apps) under it:
MySite
MySite Folder One
MySite Folder Two
MySite Bin
...
NewIdea
NewIdea Folder One
NewIdea Folder Two
NewIdea Bin (I suspect each project would of course have its own Bin folder)
...
Another Idea
Another Idea Folder One
Another Idea Folder Two
Another Idea Bin
...
I am fine with the users having to go to:
www.MySite.com
www.MySite.com/NewIdea
www.MySite.com/AnotherIdea
To get to each of these "sites" but technically each of them are totally independent and can change and be published separately as needed. Each has their own web.config of course.
Is this possible and how can I do it? I think I have all of the pieces, I just have not done nor tried it to know.
There's no reason you can't create different applications under your web site in IIS and then deploy different ASP.NET projects to the different applications. The different applications under your site can have different application pools, so you have that degree of isolation.
By default, your users would navigate to your different apps via:
MySite
MySite/App1
MySite/App2
This is probably what you're looking to do. Just create Applications (right click on your site in IIS and select "Add Application...") and then tweak as necessary.
Right click on the solution, click 'Set Startup Projects', and click the 'Start Multiple Projects' settings. Change the action for each project to whether you want to start, start with debugging or not start.
Not my kind of topic, but I suggest that this maybe helpful for you? Reading through they look rather similar, and gives you various options you can go through with and understand each more.
Best Practice for multiple asp.net web applications

Integrate multiple ASP.Net websites

I want to create a new website. The website has 3 applications, each one has its own membership/profile provider.
I want the user to be able to log in to the site with one single sign on.
Possible option AFAIK:
Define the same machinekeys/Connection Strings for all applications in their web.config files and I think I'm all set.
Does this work? And I'm curious to see if there's any other way.
Yeah, that is the path to go. Just make sure the config settings are identical and all three apps will work together just fine.
As a side: you say you want to build a new website with 3 applications. Are those "apps" separate sites or virtual directories of the top site? In other words, will they share the same URL?
The only issue I can think of is if the URL's are different then the session id's will also be different and therefore force the user to log in to each of them on access. This might be okay in your situation. With your method the credentials will be the same though.

Adding admin subdomain in asp.net

I have a website that i am hosting from home. I want to add a subdomain to my website, for example: admin.mywebsite.com Would it be best to create a new project and point DNS to that project, or should i rather create the admin application in a folder under the current project?
I don't think there is a 'best' option, certainly not one which is best in all circumstances.
Personally, I would have the admin bundled in with the main site as it will help you synchronise changes to your data access in your web application with changes in your admin system. When you deploy new versions, you know you are deploying an admin site and main site that work together. When you have two, you have two projects to maintain, two to deploy and you might find sharing code between the two a pain.
You may wish to keep the sites partitioned more strictly though so perhaps two sites is best for you. If you haven't got a compelling reason to have the separated, then don't otherwise you lose the benefits above.

Resources