Host 2 IIS sites under same domain name - iis

I have a SharePoint 2010 site and a custom web application. End goal is to be able to use cross-site JavaScript. They use different .net Frameworks so need to be separate IIS sites.
How can I host both under http://website.com and http://website.com/site2 for example?
I have tried using one site inside the other as an application using a different application pool but have issues with the web.config files because of the duplicate references needed.

Try and create a new app pool for the /site2 site. Then set the App Pool attribute enableConfigurationOverride to false. This can only be done in appcmd or by editing the IIS Config file manually. Appcmd command is this:
appcmd.exe set config -section:system.applicationHost/applicationPools /[name='AppPoolName'].enableConfigurationOverride:"False" /commit:apphost
This will tell the sub site app pool to not import any settings from the parent web.config.
I was able to run a MVC site underneath a SharePoint site with this configuration.

Related

How can I copy all IIS setting, configurations, application pools from one IIS box to another?

I have an IIS box on windows server 2012 and I want to mirror image the same settings, application pools, web sites and other configurations in another server that is also windows server 2012.
How Can I do that?
Is there any possibility to automate this process as I have to do this process very repetitively?
To Backup and Restore IIS configuration to Another Server you could try below steps:
1)if you configured the certificate with old iis site you need to Backup (export) of IIS certificates.
2)open the command prompt as administrator and create IIS configuration backup on the first server by using below command:
cd c:\Windows\system32\inetsrv
appcmd add backup srviis1-backup-2019
srviis1-backup-2019 this is a backup folder name.
After the command has been executed, a folder with your backup name appears in c:\Windows\system32\inetsrv\backup. Here is its contents for my simple website:
administration.config
applicationHost.config
MBSchema.xml
MetaBase.xml
redirection.config
3)Copy the backup folder to the same directory c:\windows\system32\backup on another server.
To display the list of all available backups, run the following command:
appcmd list backup
4)Recover IIS configuration from this backup:
appcmd restore backup srviis1-backup-2019
The list of restrictions and important issues:
The same IIS version has to be used on both servers
If any application pool is run not from the integrated accounts, they
have to be available on another server as well
Before recovery, you should export and migrate all current
certificates to the new server
I found a really genuine and effective way of migrating IIS(complete web application with all settings). It does not depend on IIS version also.
There is an API web deploy api that we can use to do this. We can do this using command line arguments or an IIS extension is also available for the same that will ease your IIS migration.
It can migrate
IIS Websites
Application Pools
Server certificates
Settings of application pools
Settings of websites
Authentication modes
MIME types
Directory Browsing
Output caching
Web binaries
And other related stuff and iis settings can be migrated using web deploy.
Go through https://www.microsoft.com/en-us/download/details.aspx?id=39277
and download web deploy for your IIS.

Kentico - Global.asax file issue after publishing

I have installed a new Kentico web application and I can browse the site without any problem. This site is hosted in IIS, Now I want to add some customization and created another web application application using MVC and registering routes etc in application start of global.asax event.
Kentico project also has a global.asax file and it contains some code logic.
When I publish my custom web project, It overwrites the existing default Kentico global.asax with global file from my application and application breaks.
Is there any way to have a 2 different global.asax file in a web application with different names? I want both global files should execute separately.
No, I don't believe you can do that. What you can do is publish your MVC site to an application in IIS instead. You might find the following article from Kentico helpful: Creating virtual directories and application pools in IIS 7.5 and 7.0

Check for IIS Application exist or not by Appcmd

How can I Check the existence of Application in IIS.
Currently i am using
appcmd list app marketsworkflowdev/NonExistApp
But it is giving me details of it's parent site detail, if application doesn't exist on iis.
How can i check Whether an application is exist or not.
Thanks
I think your looking for
appcmd list app /site.name: marketsworkflowdev
https://technet.microsoft.com/en-us/library/cc754776%28v=ws.10%29.aspx?f=255&MSPPError=-2147217396

Running ASP.NET MVC 4 app on IIS 7.5 Locally

I have an MVC 4 application that I can run using IIS 7.5. In the application properties there is an option to create virtual directory I click that button and nothing happens. When I open IIS Manager I do not see my application under Default WebSite.
UPDATE: I think I am able to setup the virtual directory. But now when I browse the web site it says "A default document is not configured for the requested URL and directory browsing is not enabled on the server".
You should change the path to your default website in IIS to see if it goes to the right place where your solution is.

ASP.NET 3.5 Permissions on IIS 6

I have an asp.net page which changes passwords in the OU. Where do I set the user which actually runs my code?
In the virtual directory security settings, is it the application pool user? Or is it in Web.config? Which one of the configurations actually configures the user that runs the asp.net code?
The identity of the user under which a web application runs is defined by the application pool which the web application uses. All of this can be seen and set in Internet Information Server (IIS) Manager.
As far as I know the Identitiy with which a aps.net application is run is set in the properties for the web application.

Resources