I have an application which has 55 host headers. How can I copy those bindings to a different application within the same IIS?
Ok take care by doing this...
Go to: C:\Windows\System32\inetsrv\config and open applicationHost.config
This file has all the sites configurations.
Find the correct site and copy the binding information to another site.
Related
Specific to Web Apps hosted on Microsoft Azure, is there a way to prevent the mydomain.azurewebsites.net URL from being indexed by search engines? I'm planning to use a web app as a staging website, and don't want it to accidentally get indexed.
I know I could add a robots.txt file to the project with everything set to no-index, but I don't want to ever accidentally publish it to the production site (or alternatively, forget to publish it to the staging website).
Is there a setting in Azure that will prevent the ".azurewebsites.net" domain from being indexed? Or if the robots.txt file is the only way, how do you keep it organized so that the right robots.txt file is published to staging and production, using ASP.NET Core.
Another option is to enable Authentication against your Azure Active Directory from the Authentication/Authorization tab in your App Service's settings for development and staging environments.
This way users will be forced to login to access those apps.
Documentation: https://learn.microsoft.com/en-us/azure/app-service/app-service-authentication-overview
https://learn.microsoft.com/en-us/azure/app-service/app-service-mobile-how-to-configure-active-directory-authentication
You can publish robots.txt to your staging server once. This can be done via FTP or via your SCM site. Once you publish this file, web publish will not remove additional files on the server (including your robots.txt file) unless you select "Remove additional files at destination" in your web publish settings.
So the robots.txt file will hang around forever on your staging server unless you remove it. Then you do not need to include robots.txt in your project or solution, and not risk accidentally publishing it to your production environment.
Restrict access based on hostname and request IP
Unless you need your staging slot to be accessible to a wide range of dynamic IPs, you could consider using the URL Rewrite module and adding rule[s] to your web app config to disallow traffic except for a few known IPs, but make those rules conditional on the HOST header matching the staging host (mydomain.azurewebsites.net), so they can never apply on the production hostname.
The details in the question here show a similar type of setup.
I have a asp.net mvc application which comes with web.config. I deploy it to my Windows server 2012 with IIS 8.
I have to make some changes to the web.config because of the unique settings on the server, for instance, disable a URL rewrite rule, to name a few.
I treat my application as a open source project which shouldn't include settings specific to my server. But if I don't put the unique settings in web.config, every time I deploy the site, I have to manually edit it again.
Are there ways to resolve the problem? Is it possible for IIS to load two web.config, one from the repository, the other somewhere on the server?
I know <appsetting> has file attribute that include additional app settings, but my changes are not only app setting.
I have several asp.net web services is running in IIS. Now I want to move to another server in all exactly same IIS setting and using same web services. I know about copying a IIS config files(ApplicationHost & administration) to new server remotely but do I also need to copy all asp.net files to new server as well? If yes then must the asp.net files be in the same file path directory as the current one(D:\Website) for IIS in new server to be able to recognize it?
Yes, you would need to copy the ASP.NET files as well.
It is not necessary to put them in the same file path directory. Whatever directory you put them in, ensure your IIS Website Settings point to that directory and you have setup the same set of permissions etc. on it.
e.g. You could have had a website on c:\site on one web server. you could move the website files onto another web server and put them on d:\newsite\ and change the Website Directory Path in IIS Manager to point to D:\newsite\ directory.
I have a Continuous Integration server with dozens of ASP.NET applications hosted on IIS. Everytime I want to deploy a new application, I have to create a new Website or virtual Directory and configure it as an application in IIS.
I would really love to have only one website listening in a specific port (say, 80) serving multiple ASP.NET sites according to wildcard host headers.
For instance:
*.dev.mydomain.int -> my server's ip address (eg: 192.168.1.32)
IIS web site reads the host header and try to find a local folder with the same name. Ex: when a request uses the host header "helloworld.dev.mydomain.int" IIS tries to open a preconfigured folder appending the host header site name (e.g: D:\dev\helloworld)
IIS serves the contents of the folder as an ASP.NET application, using preset configurations (Application Pool, ASP.NET version, and so on).
My goal here is not to create a web site or virtual directory for each and every project in our CI server. I know I can create them programmatically, but I'd prefer a more dynamic solution.
Thanks in advance
You can use MSBuild tasks to create Virtual Directories / Web sites automatically.
http://fczaja.blogspot.com/2009/02/automatic-deployment-of-webapp-on-iis.html
I had it working on a large application with many branches (we had an environment for each branch) and I didn't have to open IIS settings at all. Just pure hands-off process.
I have a little problem. I know that its possible to configure sub domains on my local Machine using host file settings and creating new WEBSITE within iis 7.
Let's say I have an IIS web site. And within it I have another web application defined as application folder not just as a virtual folder (which runs it under same process).
Basically I can access my apps like
Example
http://mydomain.com/app1
http://mydomain.com/app2
i want it to be
http://app1.mydomain.com
http://app2.mydomain.com
Looks like there is an answer at Server Fault.
Basically, create two web sites and set the host header on each to app*.mydomain.com.
But you could also use the IIS7 URL Rewriting Module, and there is an example of use, again at Server Fault
Create new websites with that hostheader and set the directory to that on the local file system of
http://mydomain.com/app1
i.e.
C:\inetpub\wwwroot\app1
Please refer to my other question for the answer to this question. Sorry for the repetition