aws CDN for single EC2

0 votes
I have installed tomcat in EC2 ubuntu 16.04. There is one mobile app which is fetching data from tomcat server (data streaming in bytes). This setup working fine in Mumbai region. Now I want to run this mobile app in Europe but server will be in Mumbai region. Is CDN correct option to resolve data latency issue or other? If yes then how can I configure CDN for single EC2? Right Now am using public domain of EC2 in CDN's origin but its not working....
Aug 12, 2019 in AWS by Ram Pal Bhatoa

1 answer to this question.

0 votes

Hey @Ram, using CDN would be the perfect choice for your requirement. It has a lot of advantages - improves website load time, reduces bandwidth cost, increasing content availability and also improves website security. Have a look at this video for setting up CloudFront distribution ec2:

Another simple approach would be to redirect the edge location to a server which is based in Europe. 

Also, can you give me more details about "Right Now am using a public domain of EC2 in CDN's origin but it's not working."

answered Aug 13, 2019 by Kalgi
• 52,360 points
Yes, I am ready to share information please tell me about which type of information you required and I watched this video. I am not using load balancer but in this video David using LB so please help me how can I do it with only single ec2 and tomcat. My email account
Hey @Ram Pal, I will require a few more details. Are you using an S3 bucket?

If you are then you can follow these steps:

  1. Sign in the AWS console
  2. Upload an S3 bucket and select every permission to be public
  3. Open CloudFront, click on get started. 
  4. Create distribution. IN the origin ID section select s3.
  5. Fill the default cache behavior settings and distribution settings based on your requirements. 
  6. Click on create distribution. It usually takes about 15 mins to be created. 
  7. To test this, change the domain name and try to access the application. I should work fine.

Neither am using S3  bucket nor LB. I have not hosted any website through tomcat8. I am using tomcat8's manager(front panel) only to upload any tomcat project noting else. Rest work by APIs only.  I have just EC2. Please check graph of network in attached image which I want to establish.

where is your application deployed? If your sending live data, you are probably using some storage service.

The thing is "origin domain name" only allows you to use S3, Load balancer, MediaPackage Origin, and MediaStore containers.
My web app deployed in ec2 ubuntu Tomcat8. This is real time data I am not saving anywhere. I have ec2 and EBS volume only.

Since you haven't deployed your application on AWS, you can use a custom origin. But this will require you to store your website or application content in an S3 bucket and then use that while creating a CloudFront distribution. have a look at the following two links. Might be helpful.

webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP