How to create subdomains using apache and aws elastic api? - apache

In our current configuration we are having one ec2 aws instance. On this we are serving one api server which is developed using laravel and one front end which is developed using angular apache. And for dns resolution we are using godaddy. Now we are having one domain let's take it as example.com.
So what actually I need is serve angular application from example.com and laravel application from apis.example.com.
And I don't want to use aws route53 service as it will be paid service again.
So is there any way through which we can acheive it without using route53 and if not how should this be solved using route53.

The steps would be the same using Godaddy or Route53. There is really no reason to think that Route53 would be required in this case.
Assign an Elastic IP to your EC2 instance
Create A records in Godaddy (or any other DNS service you want to use) for both example.com and apis.example.com that point to the Elastic IP
Configure Apache on your EC2 instance to serve requests for example.com
Configure Apache on your EC2 instance to send requests for apis.example.com to your Laravel app

Related

using shared external domain with AWS EKS Route53

I'm following https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/aws.md to setup AWS EKS cluster and managed to successfully setup cluster and a test nginx service running.
My domain is configured on Cloudflare and is used for different things i.e. domain.com lands static website, api.domain.com, app.domain.com, xyz.domain.com all are currently pointing to an IP address (LoadBalancer) on DigitalOcean Kubernetes that then handles everything and serves api and other requests accordingly.
How can I point multiple sub-domains to AWS using IP or some other way. Do I need to deploy external-dns multiple times (per sub domain)? or can I just deploy it once and use that for all sub domains? The problem here is part of external-dns config is to mention Route 53 ZoneID that is currently a subdomain
- --txt-owner-id=my-hostedzone-identifier
Okay, got the answer. First as documented in the external-dns documentation, run the command:
$ aws route53 create-hosted-zone --name "my-domain-here.com." --caller-reference "external-dns-mydomain-$(date +%s)"
Then I copied the NS records from Route53 for this new domain and added to cloudflare NS records in the DNS section. After that my K8s foo.my-domain-here.com started working!!
So moving forward, I won't need to register anything in the Route53 and just add NS record for bar.my-domain-here.com to point subdomains to EKS applications
although the domain is registered on cloudflare and is being used for marketing and other sub domains,

Why does my domain and ssl is not working correctly from every place?

I have a domain purchased at 1and1 and set up at AWS EC2 with SSL and Apache server.
Even the domain pointing to the correct IP (using nslookup I can see it), it works from some places and not from others.
For example, here from my workplace, I see this page (the domain does not reach the EC2 server):
I launched a Windows EC2 at AWS to make a test and from there, everything is correct (the page loads and SSL is valid):
From my client's computer, it has another behavior. It reaches the EC2 server, but is says the SSL is invalid:
Has anyone faced the same problem?
The first thing you need to do is get an Elastic IP, the instance IP can change during reboot etc but elastic IP are static IP’s so you should make sure you create one of them and assign it your running instance.
Create Hosted Zone and Record Sets
Documentation is here - https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/CreatingHostedZone.html
Create a recordset and add values
Add the Amazon NameSpaceServers in Control panel of Domain Provider
Import the SSl certificate to AWS Certificate manager (Optional). Documentation is here https://docs.aws.amazon.com/acm/latest/userguide/import-certificate-api-cli.html#import-certificate-api
Self signed certificate will not work.
Deploy the SSl certificate into Apache server and configure the traffic for https.
Open the AWS in-bond traffic port documentation is here - https://aws.amazon.com/premiumsupport/knowledge-center/connect-http-https-ec2/

Using AWS Certificate on Windows EC2 instance With Apache Server and Elastic Load Balancer

I'm trying to use my aws certificate with elastic load balancer on my EC2 instance which has Apache. I followed this tutorial http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-getting-started.html#configure-health-check to create my classic load balancer.After that creation everything looks right in my load balancer console . But when i try to browse my website with https instead of http chrome says connection is not secure. When i look inside of certificate from browser i see that certificate published by localhost.
So is there any additional configuration that i have to do like in my httpd-ssl.conf file or something else? By the way all this services are in the same region.(Frankfurt)
Thanks George!!! Route DNS to ELB is the key point. Since you sent that comment i had been working on it. Now i got it! Here is the link of routing DNS to ELB;
http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-elb-load-balancer.html

forwarding HTTPS from Plesk to AWS EC2

I'am quite new to setting up and managing websites, domains and stuff.
I purchased a domain (let's say example.de) and registerd it on my vserver running Parallels Plesk. As I need secure access I requested and created a SSL-Certificate at startssl.com. The developed application (Spring-Boot) runs on an EC2-Instance at AWS. The Product-Website runs on an Apache-Webserver on an EC2 instance. I need to secure both, the App (app.example.de) and the Website (example.de) using SSL.
What I want to archive is a redirect from the domain https://example.de to the EC2 Instance. I already tried several things - some I remember from the try&error marathon
Configure Plesk frame-forwarding the traffic on https://example.de to the ec2-ip
Obviously the Browser warns me that the Certificate is issued for example.de and not for and classifies the traffic as unsecure. Same like when accessing it like https://...
I also uploaded the certificate at Plesk - Also without success
Is there a solution for my setup? Or do I need (or is it recommened) to use Amazon Route53 for that task? Would be nice if someone could guide me and provide some tipps as I am pretty new to this topics.
Thanks
It seems there is no way around AWS route 53.
I figured out that there is a Extension for Plesk that is designed to route traffic using route53 and even a nice manual article at the Plesk homepage how to use any external DNS and also Route53 Extension. As this Extension requires a newer version of Plesk, than that one I am using I wasn't able to install it. I am pretty much bound to this version, so an update didn't come into question. I cannot tell for sure if using this Extension solves my initial problem, but it seems to be a potential solution.
The most simplistic solution (at least for me):
I ended up moving my Domain the AWS, created a Hosted-Zone, Added a Record Set with the IP of the EC2 and the DNS Server provided due the hosted Zone. Everything is now working like a charm.
Some more Background: The Product-Website and App-Frontend are running inside an Apache where I installed mod_ssl and configured SSL access. The Application backend runs as a Spring-Boot-App in a Tomcat where I also configured SSL using a TomcatConnectorCustomizer.
This setup works for my scenario

sshing in aws load balancer and configuring it for subdomain routing?

We want to use Amazon Elastic BeanStalk service for deployment in EC2 Boxes.
We want to deploy our Ruby on Rails Application in such a way that we can do sub-domain based routing to different rails app.
And we want to use single SSL Certificate for our load balancer and want to configure our load balancer in susch a away tha subdomain based routing takes place.
HA Proxy does this work well but when we are trying to use Amazon Elastic BeanStalk service for our deployment, aws creates a load balancer but didn't associate it with any Key-Pair.
So we are not able to ssh in load balancer and add our configuration for subdomain based routing.
Can someone please point me to some solution ?
Thanks,
Ankit.
You don't SSH into AWS load balancers, they are basically a black box that you have only a limited set of configuration options for. You probably need to look at the Route 53 services for DNS routing.
Your configuration would have routing based on domain DNS to different load balancers, one for each separate service you need. You can't have a single ELB route traffic to different EC2 instances based on domain or URI fragments.