One Website multiple Application pools - asp.net

Does anybody know if its possible to have your website run on multiple separate application pools
Some Background
I am looking into start a shopping center style site. I intend to set up
100 folders, each folder on the site will be treated as a separate site.
http://www.MyShoppingCentre/JohnsMenswear
http://www.MyShoppingCentre/GerrysGardeningCenter
I would like to have JohnMenswear running in a separate application pool
to GerrysGardeningCenter even though they are both webpages under MyShoppingCentre
Any help gratefully appreciated

Yes, create "Applications" out of each sub folder. Than the application can have a separate application pool, the same will work for Virtual Directories. Alternately you could also set up sub-domains and map each one to a separate website.

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.

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

How to nest ASP.NET websites

Is it possible to nest one ASP.NET website within another, for example:
http://example.com is an application root
http://example.com/differentsite is also an application root
If it is possible, what should be stuck in the web.config file of the parent website to prevent it interfering with the child site?
Note: This is for .NET 4.0 shared IIS7 hosting
Thanks in advance
Right click on the nested folder is IIS manager and click on "Convert to Application". This way they can live together. If you want them to run in separate processes so they won't have the same Application Pool settings, Create another application pool and assign one of the sites to it.
BTW, if the site folders are nested, they don't have to always appear in IIS manager as nested. You can add application to the default web site (or create a new site) and point it to the nested folder.
Yes, you can nest web sites by making folder an application, or adding a virtual folder that points to another application.
You need access to manage IIS on the server to do that, though.

Cannot access image site(IIS) directly

I am talking about IIS and ASP.NET application. Currently I decide to create one web application in one site (http://domain.com) and another one site for keeping images (http://images.domain.com). After a little work, I found the problem of accessing the path for creating the images from web application site to image site. One solution that is appeared on my thought is using Web Service. But I still want to hear if there are other solution for solving this problem from you guys?
A few options, most of them applicable if both sites are on the same computer, or even on the same network domain :
Give the windows user that acts as the identity of the main site's application pool, access permissions to the Images' site folder.
use Impersonation to access the other images' site folders with the right permissions.
Another option is to have both sites run as the same windows user
other then that, haveing a web service to push files to the Images site is a great and scalable solution.

ASP.NET Website inside Webforms application?

We've inherited an ASP.NET website. We've already converted it to a web application for different reasons.
But there are 2 folders with 2 .aspx pages inside that do some really kludgy things (creates a new aspx file with its corresponding code behind and save it inside one of those folders).
So when the project was a simple website, that worked because the created pages on runtime were compiled at request. This is not applicable to a web application.
We don't have time to re-code those ugly pages and do it as it should. So, is there a way to have those 2 pages (and the generated-at-runtime ones) excluded from the project and inside a website that is compiled at request? What other alternatives could you think of?
You can multiple Web Applications on a single site by designating them as separate applications within separate Virtual Directories in IIS. For this, just create a new Virtual Directory in IIS, right-click and go to Properties. Under the "Virtual Directory" tab, click Create. This will designate that Virtual Directory as a separate application.
The end result will be that "mysite.dom/VirtualDirectory1" and "mysite.dom/VirtualDirectory2" will be separate applications that can even run under a different ASP.NET runtime.
EDIT TO ADD that the downside of this is that the two applications are completely separate and cannot share Session or Application information. This can be easily solved via a Database or some other data store.

Resources