Host multiple websites using LAMP, Virtualmin and Cloudflare on Virtual Private Server - dns

Currently all my websites are on Shared Hosting. Because of slow speed I am planning to migrate them to Virtual Private Server.
My plan is to use Virtualmin on this VPS. But I am not getting any idea how to host multiple websites using virtualmin as there will be only one IP address for my VPS.
How to setup DNS records for all the websites on CloudFlare Services as all the websites will point to same IP address how do they get distinguished from each other?
Do I need to configure DNS Server on virtualmin?

Related

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

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)

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.

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.

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.

Resources