I have a asp.net website in the IIS which is available on internet as www.xyz.com now I have been asked to prepare another website which will be accessed via www.xyz.com/abc.
For this, do I need to create a virtual directory under the website folder XYZ in IIS? or is there any other way to achieve this.
You need to make the subdirectory an IIS application.
Keep in mind that inner apps like yours will be inheriting configurations from the top-most web configuration, so be careful clearing those settings you don't want in the child applications.
Yes a virtual directory will work, however note that if abc is a full-blown app you will have to add it as an application not as a virtual directory
Related
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.
I would like to nest asp.net web app within sitecore site, something like this:
<sitecore web root folder>
.
<virtual directory/app folder>
I want to access sitecore site by using following url:
http://<whatever site name>
and I would like to access web app by using following url:
http://<whatever site name>/<whatever virtual directory/app alias>
Is this possible?
I tried it but when I try to access my web app (not sitecore) then web app complains about missing sitecore.
I believe that is because now I have two config files ans when accessing web app iis/asp.net processing first sitecore web.config.
Right, your assumption is correct. See Creating a project in a virtual directory under Sitecore root article for more information about this kind of setup.
You should be able to create a virtual app under a Sitecore root path. Because its an app it will use its own app pool and you can have a web.config for it. I guess the physical files will be OUTSIDE of the Sitecore Website folder but the from a URL you can make the virtual app located anywhere below the Sitecore root.
I am currently putting a new version of my site online. I would like to retain the old site (for purposes of read only access) and have been directed to place it within a subfolder inside the directory where the site use to live. e.g.
www.example.com needs to be moved to www.example.com/old and the new site needs to be moved to www.example.com
Unfortunately I get the classic ASP.NET error when attempting to piggy back sites that each have their own web config.
It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.
How can I compeletly seperate off the new site and access it via. www.example.com/old without ASP.NET trying to trickle down through my directories and find the main sites web.config?
Thanks!
Giving the site its own AppPool should work.
You can do this by creating an AppPool and then on the virtual directory in IIS setting the app pool to your new one in the properties.
Make sure that the virtual directory is an application and not just a virtual directory.
You may try the following setting in the site contained in the virtual dir:
<location inheritInChildApplications="false">
Rick Strahl has the same problem and describes his experiences on his blog.
Didn't try it out myself, but found other blog articles which use it successfully with IIS6.
I've tried both creating a new App Pool on the site. That's didn't work -- same errors. I also added the inheritChildApplications attribute directive in my web.config. That didn't work either. The only way I have been able to achieve what I needed was to add a new subdomain in an entirely new folder and put a redirect to it in my www.example.com/old page to old.example.com.
It's not what I was looking to do, but it solved the issue.
We're having the same setup and receiving the same problem as:
IIS 6 with wildcard mapping and UNC virtual directory problem
Setup
Server 2003 32bit, IIS 6
ASP.NET wild card mapping
A virtual directory mapped to an UNC share serving static images for a CMS in a load balancing environment
My question if it's possible to turn off asp.net from virtual and only serve static files e.g. images in the virtual directory, to avoid the problem with too many open connections?
If it's not possible I'll guess I have to implement a solution like Version control of uploaded images to file system to server the files from a local disc.
I found a possible solution at http://blog.stevensanderson.com/2008/07/07/overriding-iis6-wildcard-maps-on-individual-directories/ that removes the wild card mapping and makes it possible to turn of execution of asp.net files.
There is not a way to remove .NET from a subdirectory as it is part of an application at this point (your root directory). However, this method works just fine for keeping .NET from processing your static content.
From your site that you linked:
Alternative
If you don’t like to use adsutil.vbs, you can achieve the same by exploiting what appears to be a bug in IIS Manager. Turn your subdirectory into an application (from its Directory tab, click “Create”). Then edit its script mappings to remove aspnet_isapi.dll. Then go back and “Remove” the application you just created. The metabase’s new ScriptMaps value will be retained, even though the option has now disappeared from the GUI.
I have a ASP.NET 3.5 web site, which is password protected (form authentication). But yesterday I found I was able to browse the list of directories (which is unexpected).
I searched the web, one article said we need to config it in IIS. But I'm a developer and I'm working on my local machine (no IIS installed).
My question is: are there any way to hide them other than IIS configuration? like set web.config?
This must be configured in your webserver - you cannot handle this in the website itself. Since you are working locally it shouldn't matter that the root directory is browsable. If you need to be able to control the site in this way you really ought to set up a webserver.
if you don't have IIS, you're likely working on your local ASP.NET development server (called Cassini possibly?), in which it is only available locally, so no security worries there.
When you deploy your app, you will likely be on an IIS server, so the configuration will be available
Directory browsing in IIS is controlled in the virtual directory/site configuration.
When you deploy your application to a real server you can configure directory browsing there.
Directory browsing on your local machine shouldn't matter, but this may work for you.
In IIS6: http://blog.crowe.co.nz/archive/2006/03/18/603.aspx
In IIS7: http://technet.microsoft.com/en-us/library/cc731109(WS.10).aspx
In IIS - Website properties, Home Directory tab, untick Directory browsing.
In Cassini (the ASP.NET development server) I don't think it can be turned off. But the server only runs while your debugging.