How to migrate Azure server including IIS sites with the same name, different DNS - iis

We currently have a Classic VM whose IP is directed by the DNS subdomains app.mydomain.com and api.mydomain.com. The IIS server has configured the sites app.mydomain.com and api.mydomain.com. Any user in the internet can visit both sites.
The goal is to migrate to another VM, basically creating a replica, creating two DNS subdomains app2.mydomain.com and api2.mydomain.com pointing to the new VM's IP address. As a result, visiting https://app2.mydomain.com should result in the same exact experience but be served from the new VM. Once all is tested, we would just redirect the DNS of app.mydomain.com to the new machine.
This is in theory because the IIS sites in the new VM are still called app.mydomain.com and api.mydomain.com, which will probably conflict with the DNS (app2, api2).
Are there any best practices for migrating VMs this way? There is no database involved (there is, but on a different server)

Related

Website in IIS locally and Domain Name bought from GoDaddy - What Next

I have been at this since last couple of weeks. After tiring efforts leading to nowhere, I am posting here.
I have a Website built and hosted in IIS locally. I just bought domain name from GoDaddy. I have my computer's public IP where the website in IIS is present. What are my next steps so that I can keep my computer as server and link with domain name? So that website is accessible publicly through domain name.
I saw a lot of posts with Web Hosting in Azure or other places, do I HAVE TO buy and host to make my site public?
I am a novice website builder and have very limited knowledge about this.
first you need make sure your sever is secured, only open necessary ports
go to another computer, in browser input public ip to see if you can open your webpage
then in Godaddy you can add A record for your domain, to point your domain to your public IP, refer to this GoDaddy document: https://ca.godaddy.com/help/add-an-a-record-19238
If you are not comfortable or don't resource to do these, I suggest you host on Azure or other cloud providers
You could host your application in either Azure VM or your local machine. After all, Could VM should be more convenient because you don't need spend a lot of time to handle network issue and you don't need physical space.
When you decide to host your application locally, you have to ensure your are using windows server OS, otherwise, you have 10 concurrent request limit.
Access the application via domain is quite simple.
You need to enable port like 80 in windows firewall.Promise your server are in DMZ and can be accessed externally
Create IIS binding header with null domain and your public address
Try to access your website via your public IP address
Point godday domain to your public IP address
Add your domain to your Site's binding host header->host name field
If you decide to host your application in IAAS like Azure VM, then you have to create inbound rule for your port number and allow port in windows firewall. You also have to point your godday domain to your cloud VM's public IP address and create IIS binding with your domain. Finally, you should be able to access your website.

How to add subdomain pointing to other website on same server

I have 2 websites I want to run on one virtual machine.
One is a NodeJS server, the other an Nginx server.
The main website website.example points to the NodeJS server.
Now I want a subdomain like shop.website.example to point to the Nginx server.
The virtual machine is in Azure.
I've read that it's not possible to link a subdomain to a specific port, so that's already not possible.
Would it be possible to have different IP's that go to the website, and would route to the right server based on the IP that is being used?
As far as I know, if you want to access the two websites in the same Azure VM, It's possible to use two DNS records to map to your Azure VM.
First of all, the two websites should listen on different ports. Then you can use A record to map the domain name website.example to the Azure VM public IP address. A CNAME record maps the subdomain name shop.website.example to the Azure VM FQDN. You should bind the different hostname of the websites with different ports on the Azure VM.
Also, make sure you could access the website outside of Azure. You could check the NSG rule or local firewall or website is listening for 0.0.0.0 on the Azure VM.

Azure Dns Zone not Resolving on Virtual Machine

On Azure (through portal)
Created Virtual Machine with a Static IP, data disk, and opened ports
Then remote desktop - Install IIS and FTP, ports opened in firewall
(can successfully connect via ftp client)
Created a Public Load Balancer with a Static IP with Probes and Rules
(can connect with ftp client through load balancer ip address fine)
(if I enter ip address of load balancer in browser I can view the default iis website fine) (at moment there is only one vm in virtual machine set)
Added a couple of websites in IIS, one a .net app, and the other with just some hello world .html files to test connectivity via domain name. I set bindings to host name for websites with and without www. and IP address set to all (*). restarted websites.
Created a couple of Azure DNZ Zones with A Records pointing to the Load Balancer IP address. Changed name servers on domain register to point to the azure dns servers.
However, this is where it stops. A browser cannot get to either website and I get a '500' error. dns propogation check tools verify that the nameservers are reaching azure for domain names.
There must be something really basic I am missing (???) It is as if DNS resolution is stopping at the virtual machines. Any suggestions.
If you are Configuring multiple websites in a IIS of VM and also you want to map them for different domain name, then you need to Configure Host Header for all websites in IIS (Please find below links for this) and also need to update same A Record for all your websites at you Domain provider setting.
This will work if you have separate Domain Names registered else it will not work.
Without domain name you can deploy websites on different ports in IIS and then configure custom domain in Azure Load Balancer NAT rules.
Links for Host Header config in IIS
https://technet.microsoft.com/en-us/library/cc753195(v=ws.10).aspx
http://support.simpledns.com/kb/a82/virtual-hosting-with-iis-internet-information-services.aspx
This was my fault in some missing hyphens in the zone record. The other .net website was throwing 500 errors sometimes instead of error-name-not_resolved from incomplete nameserver propogation and incomplete .net configuration for the website on VM
The host headers were set correctly including www.xxx.com and .xxx.com variants for both port 80 and port 443, and I did have the 'A' records with both # and www variants in the zone set to the IP of the load balancer correctly.
For anyone else with these issues, when checking for localhost connectivity test on your virtual machine (assuming you are hosting multiple sites), remember to add a virtual directory in IIS manager pointing to the file location along with an alias.
While a learning curve, the whole infrastructure of Azure is quite amazing! Impressed.

Can a managed website and a virtual machine share the same domain name in Azure?

I have a website hosted on Azure as a managed site. I need to run a separate FTP server and a custom Windows service on virtual machine, but need them to share the same domain name as the site. So what I'd like to be able to do is have mysite.com port 80 go the website, but mysite.com port 21 etc go the virtual machine and connect with the FTP service. How would I go about setting that up?
When a user looks up "mysite.com" they are going to get a single IP address, and there is no way via DNS to return different IP addresses based on the port number you are trying to use. You have a couple options to achieve this solution:
Setup an intermediate routing service that accepts all traffic to mysite.com and then routes the traffic to the appropriate website/VM based on the port number. This is non-trivial and may incur extra costs (you could build the routing service into the existing VM that is serving FTP to reduce the cost).
The easier solution is probably to have a CNAME for www.mysite.com pointing to the website, and a CNAME for ftp.mysite.com pointing to the VM.

Point/Send domain name to website on Windows Server 2008 R2

Okay, can't seem to find a great article or info on this. My client purchased a domain for his company (domain.com) through Network Solutions. He has a local server running Windows 2008 R2 that he wants to host his company's website on. I've created the website and have it running with Apache on localhost. The server does have a static IP, but when I visit it, I'm prompted for credentials (user, password) which is expected as it's meant to be protected.
My question:
How would I point the domain to the website on his server?
From what I've researched, I have options that include:
Pointing the domain to the static IP (what about the credentials?)
Creating A and CNAME records for the DNS server on Network Solutions
Setting up a local DNS server w/ Active Directory on the Windows machine
Creating a couple name servers that would tell Network Solutions
where to send the domain
It's safe to say I'm effectively confused, so any help would be very much appreciated.
So basically you have to associate the domain name to the IP address, and that is done using DNS.
I'd suggest option 2 where you let Network Solutions manage the DNS, and you create an A record for www.domainname.com that points to the IP address on your server. Keep in mind it might take 24-48 hours for this new record to propagate across the internet. Take a look at http://www.networksolutions.com/support/dns-manager-advanced-tools/ and http://www.networksolutions.com/support/a-records-ip-addresses/
Regarding the credentials prompt, I assume you are using IIS and so you'd want to check the Authentication settings for the site. If you want anonymous access to the site, you would enable it there.

Resources