AWS multiple sites, one instance, multiple ports - amazon-web-services

I have one Wordpress on Apache already deployed on port 80 and configured through Route 53. This is obviously on port 80. Now, I have created a new project in react.js that is listening to different port, port 3000. Both sites are on the same EC2 Ubuntu instance. I would like to attach to the second site (node.js) different domain name and configure this to work, however, I don't know how to do it. Can you please help?

Point the two domains to your EC2 elastic IP(A records).
On apache, configure virtual host which enable you to run two web site on a single machine. see this link: Apache Virtual Host documentation - Apache HTTP Server Version 2.2

Related

How to access a website that is deployed in a Windows instance in EC2?

I have created a Windows instance in EC2, also installed the Bitnami WAMP stack there. The web app runs on the instance, however it does not display on a browser outside the instance with the public IP of the instance.
I have configured the Security Groups this way:
Port 80 (HTTP inbound and outbound)
Port 443 (HTTPS inbound and outbound).
What else need to be done, in order to display the web app on a browser? Thanks
The issue was solved by disable the Firewalls on the Windows O.S directly (instance).

VM Instance group to configure to listen on port 80 and 8080

I have configure my VM in such a way that I have 2 application running on one VM.
First App listen on ip:80 port
Second App listen on ip:8080 port
I have enabled ports on VM instances group like this.
I have my Load Balancer configured with two front rules like this.
I want to map ip1:80 to my 80 port application and ip2:8080 to 8080 application
when I tried accessing my application using load balancers IP address it always show me 8080 port application.
I have two backend service running
help me here google team. I m newb
If you want to use IP addresses but not URLs/Domain(s) to reach to your web applications, then URL Maps cannot help to implement your design, as URL map forwards the request to the correct backend service using host values (example.com) and path values (/path) in the destination URL.
That being said, you can add one more Target Proxy to your LB resources to route incoming requests directly to the desired backend services. This will allow you to keep your minimum number of instances as one VM.
For more information, visit this article.
I had similar problem and I had to add second backend.
So I have two backends: one for 80 port, other for 8080. And I have on managed group.

Google Cloud Load Balancer different ports

Under Load Balancer,
I have two domains
www.xyz.com
search.xyz.com
and on Google cloud (one of the VM), I have apache running on port 80, and nodejs running on 8080.
I want to create two backends to the same group with different ports (one of them to apache and on of them to nodejs),
if host name matches forward to different backend
for eg.
www.xyz.com should goto backend host port 80
search.xyz.com should goto backend host port 8080
I tried added backends in console, however it keeps overwriting other.
I had the same issue and solved it by using different port names for the service.
This issue is described in detail in the Load Balancer documentation, under Restrictions and guidance for instance groups:
If your instance group serves two or more ports for several backends respectively, you have to specify different port names in the instance group.
It's easy to overlook, but when you create a backend service, you're asked to name the port. The good news is that you can rename the port easily.

Running two meteor apps in the same aws instance on two different sub-domains using Route53

I have two Meteor Apps deployed in the same AWS EC2 instance. One of them running on port 80 and the other which is the admin app running on port 8000. Both share the same local MongoDB. Now I want to create a sub-domain like dashboard.myapp.com and point it to myapp.com:8000.
Create a dns record pointing to your AWS EC2 instance, install nginx and configure it to redirect all request to dashborad.myapp.com to port 8000 and the other to port 80.

How do I link my Route53 domain name to an application running on an EC2 instance on a specific port?

I've a django application deployed on an ec2 instance (with public IP a.b.c.d) on port 8080 and have a domain name 'xyz.com' purchased via Route53. How do I link the domain name to my application server?
I've gone through a lot of docs, but it does not seem to be working. I see that while adding a record set, I need to enter the public IP of my ec2 instance in the value field, but how do I get it to route traffic to port 8080 on the box? If I enter a value like a.b.c.d:8080, it errors out saying "The Value field contains invalid characters or is in an invalid format."
Steps I've done so far:
Took an ec2 instance, deployed my web app on port 8080. Everything's
working fine and I can access my app using the public IP (will go
for an elastic IP later)
Registered domain name with Route53.
Created a Hosted Zone with the name of a subdomain.
Created a Record Set with the following info:
Name:
Type: A - IPv4 address
Alias: No
TTL(Seconds): 300
Value: <THIS IS THE MISSING PIECE I GUESS>
Routing Policy: Simple
Can someone point me to any documentation for this? It seems to be a straightforward thing, but somehow I cannot find how to link the pieces.
You shouldn't enter your port, just your IP. Your application will then be accessible at: xyz.com:8080
To make it accessible at xyz.com you need to configure a web server (like nginx, apache...) or a proxy that will redirect the requests coming on port 80 to port 8080.
Django on Nginx with uWSGI: http://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html
You can also make your django app run directly on port 80 but apparently it's a bad idea: Run Django without Apache using runserver on port 80 and accessible outside LAN
Just want to point out that SRV records do support port definitions in DNS, but we should not expect browsers (or many clients for that matter) to query for SRV records.