In my previous posts I mentioned several times about a possibility of using Amazon AWS, but I didn’t have a chance to write a guide about it. Well, let’s fix that.
I’ve already told about cloudflare CDN in another article, now it’s time to be more detailed about the most famous and popular service at the moment — Amazon AWS. I won’t give general info about it here. Again, the service is very popular, so you can easily Google everything that you want to know about cloud infrastructures. I’ll just say that access to Amazon AWS is absolutely free for a year.
How Can You Use It?
Sometimes a task requires a series of short tests for some rare geo, in which it’s difficult to find a server. This is exactly when CDN becomes very useful. Usually I test on CDN first, and if I see that an offer has potential, I create a droplet closer to the geo and then work directly with it. I wouldn’t switch to using only CDN because the results of my tests have proved that it’s better if a droplet is located closer to a geo. However, if you’re a novice and you don’t want to waste time neither on setting several droplets nor on studying about them, the CDN will be a good choice for your first tests of global offers. Finally, don’t forget that CDN doesn’t support php, that’s why all your landings must be in html+js+css.
The registration is quite simple, I only want to clarify some aspects in advance:
1. You need to have a real phone number
2. You need a credit card or a virtual card with at least $1 balance to use it for registration.
So, sign up here:
Then enter your name (you can input any name) and a real phone number:
Now it’s time to add credit card information:
You need to be able to receive a phone call to the number indicated during the registration and enter the code given by the system with phone keypad :
Enter the code, pass verification, and you’re registered. Enter your account and choose Cloudfront
Here you need to make two short steps:
1. Click Create distribution
2. In the Web section click ‘Get Started’.
On that page you will see settings of the domain where your landings will be located.
Here you will need a domain. You can already have one or not, in the latter case you need to register it somewhere. I prefer namecheap. They often have special offers and discounts, currently they sell domains in .bid .xyz .trade .webcam .pw .website .top .tech .space .site .press .online zones for only $0.88. I’ll use it and register mobilander.xyz domain for landings. Registration in namecheap is also simple, and if you’ve ever purchased a domain at least once, you’ll understand the system quickly, if no, you can google a guide on how to register a domain. So, I assume you have a domain registered.
Let’s go back to AWS settings. Except the lines marked red you don’t need to change anything in this section unless you require any specific settings.
1. Input your domain name into the Origin Domain Name form, for me it’s mobilander.xyz
2. In Origin ID write any random name
4. Alternate Domain Names – you need to make up and input any subdomain name of your domain that will be linked to cloudfront.
For example, antivirus.mobilander.xyz. This domain will be used everywhere in public. That means landings will be displayed from it.
Finally, press «Create Distribution». You will see the following:
Then goes the final part – you take the domain titled xxxxxxx.cloudfront.net (marked red) in the list of distributions in the Domain Name field and copy it to the CNAME of your registrator for your subdomain. More info below.
Here I’ll describe the simplest variant with ordinary shared hosting and custom DNS from namecheap. Remember that this guide is for novices, and users who prefer more advanced tuning are recommended to read these articles: DNS from cloudflare and server setting for landings on Digital Ocean.
You can pick any shared hoster you want; as for me, I prefer guys from IDEAhosting. Their hosting is for affiliate marketers, and you might also like and rent their servers, VPS, etc. later. By the way, you can get good customized configurations for reasonable money, contact the support to find out more about that opportunity.
So, you’ve bought a hosting service and have all necessary data for access to the ISP manager console or similar. Add the domain to the hosting:
Copy an IP address of your hosting from this page as you’ll need it in order to add the domain by A-record. Then go to namecheap or another website where you registered your domain.
In namecheap it’s done the following way:
1. Choose your domain in the dashboard, then clear Advanced DNS from all existing records.
2. Add the CNAME record for your subdomain.
3. Add A-records to your domain. Write the IP you’ve copied from the hoster in the ISP manager console above.
Finally, it looks like that:
The setting is over. Now you need to wait until the DNS update and settings come into effect, and after that you can upload landings on the hosting.
To do that, go back to the ISP manager console, upload your landings into the origin domain, i.e. into the folder of mobilander.xyz domain in my case (note that you upload landings there, not into subdomains’ folders). Once the upload is complete, the landings will be cached with the help of CDN from there.
Open the folder, upload the landing into that folder. Now you should also remember that despite the fact that the landings were put into the root of the mobilander.xyz domain, the links should look like this:
instead of http://mobilander.xyz/mobilelander/index.html
Don’t forget to always use the Alternate Domain Name, otherwise the landing will load from the shared hosting.
Having been uploaded on CDN once, a landing will be cached and stay like that until you clear your cache. That means, if you change your landing a little or even remove it without clearing cache, you won’t see any changes and the landing will stay on AWS exactly the way it was uploaded first.
That’s why, in order to answer possible questions in advance, I’ll teach you how to clear cache so that you can freely change landings when needed.
Do the following:
1. Tick the checkbox with your domain and press Distribution Settings
2. Invalidations -> Create Invalidation
3. Clear cache, enter ‘/*’ and press Invalidate
That’s all I wanted to write about in this article. Good luck and wish you all good profit!