IIS- multiple sites vs one site with multiple child applications - iis

What is the best approach when I have multiple websites on the same ip address
like:
mywebsite.com
crm.mywebsite.com
api.mywebsite.com
etc.. (5 sites in total)
Should I create 1 site on IIS (mywebsite.com) with 4 child apps (crm.mywebsite.com, api.mywebsite.com...)
or
create 5 different sites
Thanks!

I think you should create according to your requirement. If you have multiple websites on the same ip address, then you can run Multiple Websites on the IP Address on IIS.
what you need to do is configure a Host Header for a Web Site, More information you can refer to this link: Configure a Host Header for a Web Site

Related

Host Multiple websites on azure virtual machine

I Have created a virtual machine on azure and hosted one web applications(react and nodejs web app) with iis web server.
Now I want to create a one more (Wordpress) web applications with same Virtual machine on iis web server.
Is it possible in azure to host multiple websites with same ip address of virtual machine?
Yes, you can do that, IS can manage different sites with host headers functionality
Host multiple Web sites on one server.
Hosting multiple websites is supported by IIS.
If you want to share same port number for multiple websites, then please remember to specify public domain name for each site.
If you don't have so much public domain and you just want to access your website via External Firewall IP address, then please set different Port number for them.

Multiple websites on one IIS server

So if I have two domains i.e. domain1.example and domain2.example, both pointing to the exact same IP address (i.e. 192.0.2.1) on port 80.
How do I take users from domain1.example to one site, and users requesting from domain2.example to another site?
Additionally how do I set up subdomains? Someone requesting x.domain1.example should go to a third site.
When you configure the site in IIS you can assign the necessary host name in the bindings and the site will only respond to this.

Bind multiple SSLs on single website in IIS 8+

I have one website configured for Windows Server 2012 IIS 8. This one website can be accessed by xyz.com or abc.com (2 different top level domain names). Is it possible to configure SSLs for both?
Yes. You can configure two different domains with two different certificates for the same IP and port no(443). After providing the domain name in Binding, enable check box Require Server Name Identification(IIS8). If you do not enable this check box, two websites will have the same single certificate, if you change one website binding file, it will reflect in other website also.. I have experienced.
Please refer below link.
http://www.orcsweb.com/blog/fred/host-different-ssls-on-one-ip-with-iis-8-sni/
As Windows Azure web site is powered by IIS, you can see from the offerings that it is possible to bind multiple SSL to a single site,
http://azure.microsoft.com/en-us/pricing/details/web-sites/#web-sites
The trick is to use SNI,
http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-server-name-indication-sni-ssl-scalability
Yes you can add multiple https bindings each with their own separate ssl certificate to the same site in IIS. However you'll want to bind them to separate IP addresses so that the certificate for xyz.com is bound using the IP address for xyz.com, and the certificate for abc.com is bound using the IP address for abc.com. But frankly, it'd be better practice to have one redirect to the other, or just make 2 sites in IIS and keep everything separate.

Hosting software on my server that allows users to point their domain to using CNAME

I am creating software that allows users to either have their own custom subdomain (e.g: theirsubdomain.mydomain.com) or point a CNAME from their own domain to my website address (e.g: theirsubdomain.theirdomain.com).
I've contacted my host about this and the first subdomain option is cool. They will set-up a wilcard subdomain script for me...
The CNAME they said I can't do automatically. I will have to manually go into my account and add the domain to point to my website address otherwise apache wont now where to look for the files.
Is this common practice or is there a way around this that is automated?
The issue is the HTTP header. When you request a Web page the browser sends a request that starts out with:
GET /mypage.html HTTP/1.1
Host: www.mysite.com
The Host item allows a single Web server to serve pages for multiple domains. By looking at the Host, the server knows that mypage.html should come from its stored files for mysite.com, and not from the files of myothersite.com which is on the same server.
I am guessing your site is on a shared Web server at your host company, and they use this functionality to differentiate between requests for your site and requests for other sites that sit on that same virtual box. Some of these virtual hosts, like HostGator, will allow you to specify other domains that should be accepted on this Host line and where the returned documents should come from. This often is a more premium service offered by companies. For example on HostGator they say "The Baby and Business hosting plans allow for unlimited domains to be hosted on just one single account", however the basic Hatchling plan does not allow this.
If you have your own rented machine, with your own installation of Apache, you can manage the processing of this HTTP header information yourself. Apache supports virtual hosts, see the following documentation: http://httpd.apache.org/docs/2.2/vhosts/
So basically, you have to have some way to tell Apache (or whatever server you are using) that the files for a particular Host value corresponds to the same files for your domain, since a single Apache server may be providing files hundreds of different domains. If you are not administering your own Apache server, to where you can set up virtual hosts as shown in the documentation, the hosting service would have to provide some custom way to get this information to Apache.

Redirect SubDomain Request to a Specific Port

I have a SharePoint solution running, with different applications running on different ports. Now I have to assign 3 subdomains to 3 different applications like:
sub1.domain.com on port 36358
sub2.domain.com on port 36359
sub3.domain.com on port 36360
My network admin says that dns setting goes as long as server address, not a specific port. Now, can I set my SharePoint IIS so that requests for different subdomains go to their related ports?
You setup the host headers for the specific Web Sites.
From IIs manager:
< Your Web Site >->Properties->Web Site->Web site identification->Advanced
Also, you will need to add your full domain name in the "Define managed paths" in WSS Central Admin.

Resources