specify a domain when deploying on iis - asp.net

I am deploying a web application to a windows server 2008 named jonny521 using IIS7. The domain for most applications on this server is jonny521 however one of the application's domain is jonny521.development.local and I'm not sure how the application got that domain. I want to deploy another application to the domain jonny521.development.local so that it has access to the same cookies.
Does anyone know how I can put my web application in the domain jonny521.development.local?

You can put an application on arbitary domain on your Iis. Just create a new website and in website properties, set the domain as the host name.
The remaining part is resolving the host name by your os so that when you navigate, you get to correct server. You can use a dns server but you can also modify the local host file (system32/drivers/etc/hosts).

Related

Wildcard sub domains in IIS10

I want to access the application www.testsite.com using different wildcard Sub-domain such as :
abc.testsite.com
xyz.testsite.com
I have installed IIS Express 10 on windows 10 Machine and followed below steps:
Created an simple Asp.net MVC web application and published in local folder
Added an website in local IIS as www.testsite.com
Mapped the website to the published folder.
Added binding as *.testsite.com
Edited host file with 127.0.0.1 www.testsite.com and 127.0.0.1
*.testsite.com
Now I am able to access www.testsite.com but not using any other sub domains
Am I missing anything ?
You can add wildcard entry on IIS, but you have to specify the list of subdomains that you are going to map. Ultimately host file will not support any wildcard entry.

How do I get IIS to direct traffic to other binded directory

I have two sites configured on my IIS 7 server. One is the default web site and the other we will call www.othersite.com. The default web site runs a few different Applications running ASP.NET and the other site is a ColdFusion 8 web site.
The default site is configured to pull from the default web location at C:\inetpub\wwwroot while the other is set to pull from C:\sites\othersite.
The bindings are set to send all unassigned traffic to the Default Web Site, but www.othersite.com is set to a specific IP address. This is the same as I have it on other servers, which work perfectly well, but for some reason when I load www.othersite.com it is looking for its files in C:\inetpub\wwwroot instead of C:\sites\othersite even though the physical path is clearly defined in the basic settings.
Anyone have any idea why this might be and how I can get it to point to the proper directory?
Under IIS >> Bindings, you can see a place to put in "Host name". Leaving blank will result in all traffic to IP or host, but by specifying a host name (www.othersite.com) will direct traffic to that dir/site.

Is it possible to run ASP.NET in IIS 7.5 without creating Virtual Directories or Applications?

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.

Setup local domain with IIS7

I want to setup local domains like sub1.mydomain.dev and www.mydomain.dev on my local IIS on Windows 7 to test cross-domain things (asp.net app)... is there anyway to do that ?
This should not be done in IIS, but in the DNS server.
You can spoof this by updating your hosts file and add entries for the additional domain names, pointing them to the same server.

Error attempting to access a web service (hosted locally or externally), can't resolve host name

I'm stumped. I've got an asp.net mvc app being hosted on a shared hosting provider. The configuration of their system leaves a little to be desired, but it's cheap (getting what I pay for I suppose...)
The problem is this: The application is hosted at the root level of the hosting account. I have a virtual directory established underneath the root that is running a .net 2.0 web app along with a web service. I can access the web service directly via the domain/subdirectory url. The main web app (at the root level) needs access to the web service in the virtual (subdirectory). Locally in development, I can run the app against the web service out on the hosting server and it runs just fine. When I push the web app up to the root of the hosting service, I get "The remote name could not be resolved: ".
At first I thought the error was related to the DNS settings of the primary domain since both the web app and web service technically live at the same domain. As part of just trying to get something working, I reverted the web app to reference an older version of the web service on a different server (different host altogether). Again, it works fine locally. When I push the updated web app, I got the same error, but noticed the host name referenced is that of the external domain. Of course, I can access the web service via the browser just fine.
Sorry if this doesn't make total sense... it's late and I'm beat from looking at this for the last few hours. Any help would be greatly appreciated.
EDIT
So the web app simply has a Web Reference to the web service (I could probably just restructure the app avoiding the web service altogether, but time is of the essence [for now]). Since I got stuck last night, I pointed the web reference back to an old server but the issue remains. Right now the url the web reference points to is http://road34.hi-fisoftware.com/webservices/giigsterservice.asmx.
If the server has a firewall then and an external ip and different internal ip then probably you will not be able to access the webservice with the domain name. you will need to access it as internal url or as relative url.

Resources