Amazon EC2 multiple domains - iis

I have a windows server 2012 r2 and would like to host multiple domains with different sites, for example www.domain1.com.br, www.domain2.com.br, teste.domain1.com, ...
I'm having trouble because the DNS www.registro.br only accepts IP entries only with port 80 by default. My amazon ec2 only releases a public IP for that. How can I configure my IIS to accept these multiple sites? I searched the Internet and found quite the VPC amazon but was not used for this purpose.
What should I do?

You can point all your sites to the same single IP. In the 'bindings' section of the IIS manager, you tell each site you have setup, what domain to answer for...its really quite straightforward.

You need to create a custom Tcp rules in the security group with another port and set the firewall settings to allow port connection from 81 or any port of your choice. Check this out http://techcerberus.blogspot.com/2018/02/how-to-host-multiple-website-on-amazon.html

Related

Forward specific port of a domain.com:1234 to different IP

my domain "https://example.com forwards to my webserver IP eg "0.0.0.1".
Is it possible that when I call the domain like "tcp://example.com:1234" to forward the request to a different IP like "0.0.0.2:1234"? Or is the only way to use a subdomain?
Thank You!
It's about a self-host or a shared host on a service provider?
If it's a self-host:
Someone receives your internet connection, in the business environment we usually use a firewall, so you just need to create/configure (on the firewall) your "nat rules" to work as you need with specific ports and IP.
If it's a service provider:
You must do check if they allow nat configuration (can be called port forward or publish rules)

Host a web site in an Azure VM

I have a Azure VM. Using the IIS, I host a website in the VM.
How can I access that website via the DNS name (like http://abc.cloudapp.net/)
I know this is the most unlikely, we should use the "web role", but I really need this works, is this possible?
I tried with the localhost, it works, the internal IP works, but the DNS name doesn't.
Edited to provide more info (March 09):
I have already have endpoints setup. "binding" uses the dns name. I have two website, one hosted in the port 8081, it works. Another one hosted in the port 80, which doesn't work.
http endpoints
the port 80 doesn't work
the port 8081 works
If I understand correctly, your VM already has a Azure domain in the form of myvmname.cloudapp.net right?
First you need to add an ENDPOINT in the VM that bridges the port 80 from outsite to inside (if that is the port indeed you configured in IIS).
Then, you need to add a CNAME record in your DNS table that points from www.mydomain.ext to myvmname.cloudapp.net (obviously replacing the correct values).

How to access a site on AWS EC2 without a domain name

I just created a new site on my IIS on Amazon's EC2 and I was wondering if there is a way to access it publicly without assigning a domain.
In detail. I created a new site dev.example.com which is accessible when I am logged in my instance. Is there a way to access it outside by doing let's say 54.xxx.xx.xxx:80:dev.example.com
I don't know if that's even possible so any hints are appreciated
You can definitely do this, but here's what you'll need to do:
Make sure IIS is configured to route any incoming connection on a particular IP address to your site. This is distinct from IIS specifically listening for a particular hostname (e.g. mywebsite.com).
As an alternative to the above, you could also manually set your DNS on your local computer and then use your web browser to visit mywebsite.com. From IIS's perspective, a user will have requested mywebsite.com just as if public DNS were set
As far as the IP address you visit, your instance will either have an ephemeral Public IP Address which will be reset when the instance is stopped and started, or an Elastic IP Address, which persists across restarts.
As #Anthony Manzo mentioned, you'll need to make sure that your Security Group associated with this instance allows Port 80. In addition, you may want to disable Windows Firewall completely (or check that it allows Port 80 on all three "Zones" (Windows Firewall has 3 different zones to manage).
Afaik the IP addresses assigned to EC2 instances can change throughout its lifetime and therefore you should instead generate an Elastic IP Address (which will always direct to your instance). That way, you don't have to deal with DNS yourself and still are always able to connect to your instance.
Have a look at the "Security Groups" on the left hand of your EC2 web console. You'll have to allow TCP 80 (and whatever else) in the Security Group (probably 'default') first.

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.

Can't get Azure Virtual Machine to serve websites

I've just set up a windows azure VM and installed IIS on it.
When I remote desktop onto the box I can see the default IIS website fine but I can't get this to serve on the web from the IP address of the box.
I've opened up port 80 on windows firewall and also added an endpoint for port 80.
I've tried to access it with the firewall completely turned off also but to no avail...
I cant work out if there is anything else I need to do to get this working?
Add endpoints for port 80 (http) and port 443 (https) to the VM in the Azure portal (tip: this can be automated with powershell or the Azure cli).
Remote desktop to the machine. Open the Windows firewall control panel and allow traffic to port 80 (http) and port 443 (https) or just turn it off ... the firewall is ON by default (tip: can also be scripted through the VM agent / powershell).
Go to the Azure portal and find the cloudapp.net subdomain for your VM (actually the cloud service) your VM is running under. Try accessing the site with that domain. If that doesn't work, try browsing to http://localhost on the server (remote desktop) to make sure IIS works and troubleshoot from there.
Modify the DNS records of your custom domain to use a CNAME to the .cloudapp.net domain. If you need A records make sure to use the public IP of the cloud service (just ping the .cloudapp.net domain to find it or look in the Azure portal).
You might want to look into Azure Websites or Azure Cloud Services (web roles). Those are a lot easier to manage and a lot cheaper. They still offer most of the functionality.
What fixed the issue for me was to go into the Azure Portal, browse to 'Network Security Groups', select the VM and then create an inbound rule to allow traffic to port 80.
Note: Also ensure that the inbound rule to port 80 is added and enabled on the actual VM.
Well, I deleted the existing VM and Cloud service and started again - all worked fine out of the box this time.
How annoying! The only thing I did notice was that before my cloud service had the same name as my VM - this time they had different names so that might have been what was causing the issue.
Cheers
For the newer VMs and pre-configured setups (2015+), it's possible your setup is using an azure asset called "Public IP". If so, you can set a custom DNS name label in it, inside "Configuration". Note that this name will consider any type of region used when creating the VM (e.g. my-site.brazilsouth.cloudapp.azure.com).
It's good to remember that for testing purposes, it still suffices to use the value of the public IP that is randomly designated to you.
The VMs are actually accessed via a Cloud Service (well they are for me). Azure created a Cloud Service automatically to be the scaling engine/load balancer on the front of the VM. I have to connect to the web site via that cloud service, not the VM directly.
Its possible you were using the internal IP rather than the external IP.
The sites have to use the internal IP address in the bindings section of IIS. However, in your dns you will need to use the external IP. This is presumably since the 'internal IP' is just a virtual one that Azure uses to map traffic from the external network to the VM's inside azure.
You should find both the internal and external IP's are visible on the VM's desktop.
Switch off TLS 1.3 in the Registry Editor.
This is what worked for me as of writing this in Mar 2021.

Resources