Home > The Newbie Zone >

Easy and affordable infrastructure for everyone (15)


09-17-2021 03:21 PM #1 twinaxe (Senior Moderator)
Easy and affordable infrastructure for everyone

I wanted to write this guide for long time already and now it´s the time

From what I read here and from what I know when I was doing pop coaching the techinical aspect is a huge issue for many people.

You want to run campaigns and promote offers so why should you mess around with server stuff as well...

Today I will show you an easy and affordable way to setup a good infrastructure to use.

In this tutorial we cover:
- The server
- CDN
- DNS
- Domains and SSL certificates

This tutorial is more for beginners and exactly the way I describe it will work for up to 500k clicks per day, that has to do with the server configuration we use for it but 500k clicks per day should be enough in the beginning and keep you busy for some time

Although this is a tutorial for beginners I won´t show how to sign up for accounts at the services we use, you should be able to figure it out yourself or it´s already covered here anyway

Let´s start with the server.

When you use a self hosted tracker you can use the same server where your tracker is installed for your landing pages as well, when you use a cloud tracker you need the server only for landing pages.

Login or sign up to Digital Ocean and create a droplet.

For the distribution click on Marketplace, search for "lemp" and then select LEMP on Ubuntu 20.04.



LEMP just means that the server will have Nginx, MySQL and PHP already installed when it´s ready to use and that way the whole installation takes only few minutes.

For us most important is the Nginx webserver.

Choose this plan:



For datacenter you can just choose London or Frankfurt.

For authentication you can keep password, that´s how I do it myself as well.



When the droplet is created the server is ready to use, let´s continue with the next step:

CDN and DNS

Amy already did a great job with her tutorial for hosting and CDN but let me show you how I do it

Instead of using Amazons infrastructure we use Cloudflare

To use a CDN and DNS of course you need a domain so first get a domain from Namecheap that you want to use for your landing pages.

You can use Cloudflares DNS for your tracking domains as well, the steps are always the same but tracking domains can mostly/always be added to your server from within the tracker itself.

To add landing page domains to a server can be a bit more complicated, that´s why I show you how to do it easy-peasy as well.

Ok, when you got your domain from Namecheap go back to Cloudflare and add the domain there.



Enter the domain name and click "Add site".

In the next step choose the free plan.

Yup, that´s correct.
It´s free, no costs, nada, nothing , nichts, niente, ничего.



In the DNS settings you can delete all the records, in the end you only need an A record to connect the domain name to your server IP.

When all other records are deleted click "Add record", select Type "A", in the field for Name you put your domain, in IPv4 address you put your server IP.

Keep proxy status checked, this is the setting for the CDN.

Attention: That´s only for landing domains, for tracking domains uncheck proxy status so that you only use Cloudflares DNS but not CDN.



If you also want to use your domain with www.yourdomain.com just add a "CNAME" record as well where you put www in the Name filed and your domain name in Content.



Don´t forget to save and when you´re done with the settings click on "Continue".

If you want to use Cloudflares DNS for a tracking domain you can add the domain exactly as before but then uncheck the proxy status.



Now you need to connect Cloudflare with Namecheap, to do so you need to add Nameservers from Cloudflare to the domain on Namecheap.

You find the Nameservers in the DNS tab right below your settings.



Copy the 2 Nameservers from there and add them on Namecheap to your domain.

Go to Namecheap and click on "Manage" for your domain.



For Nameservers choose "Custom DNS" and add the 2 Nameservers from Cloudflare there.



Ok, now your domain is added to Cloudflare so that it can use Cloudflares CDN and DNS.

It´s also connected to Namecheap.

Now we need to add the domain to the server.

To add the domain to the server the DNS propagation needs to be done first.

You can use THIS SITE to check the status.

Enter your domain there and click "Search", when you see your server IP in the results you can move on to the next step.

To add the domain to the server we just use Binoms auto install script, that way you only need 1-2 little commands and that´s all.

The script works even when you don´t use Binom as a tracker and will add the domain to your server and also automatically install a free SSL certificate.

This is also the reason why you need to choose a specific Ubuntu version and LEMP with Nginx as web server, otherwise the script won´t work.

First connect to your server as root user either through terminal or PuTTY.

The command through terminal is

Code:
ssh root@your.server.ip
Then enter your password.

How to connect through PuTTY you can read HERE.

I don´t use putty myself but the connection should be pretty much the same, you also need your server IP, username (root) and password just that you have a GUI there for these things

When you are connected to your server you first need to download the Binom install script.

You can get it with this command

Code:
wget http://data.binom.org/binom_install.sh -O /root/binom_install.sh
Then run the command to add the domain to your server

Code:
bash /root/binom_install.sh lpdomain
Just choose option 1 to add a new LP domain, enter domain name and email and that´s all.

The script will add the domain together with a free SSL certificate to your server.

In case a domain gets flagged you can also delete it with same command and choose option 2 instead.

When everything worked you will find a new folder with your domain name on your server in the directory /var/www



In this directory you can now upload your landing pages that you want to use with this domain.

Of course you can also add subdirectories there that then can be accessed through

yourdomain.com/subdirectory

Usually the SSL certificate will renew automatically but sometimes it doesn´t work.

In that case you can also use the Binom script to just renew the SSL certificate.

Use command

Code:
bash /root/binom_install.sh ssl
Enter domain name and email and voila, you have a fresh free SSL certificate.

Advanced chapter

Better only continue here when you know a bit what you´re doing, otherwise it could be too confusing so that it´s better to stick with the easier part first.

In my opinion the only downside with this system is that you have a new directory on your server for every domain that you add there.

I prefer to have the directories for my landing pages per vertical and not per domain.



That way I only need to upload the landing pages once and can use them for many different domains.

When you want to do it that way you just need to make some small changes to the configuration file of the domains.

For each domain you find a file in the directory /etc/nginx/sites-available

Open the file and go to line 5, there you will find the root directory for the domain.

By default it´s set to "root /var/www/yourdomain.com;"

This means that the domain loads its files from the yourdomain.com directory in /var/www/

When we want the domain to load the files from the sweeps folder in /var/www/ we need to change the root folder in the config file to "root /var/www/sweeps;"

To activate the changes you need to run this command in either the terminal or PuTTY

Code:
service nginx restart
That way you can use as many LP domains as you want to and still keep a clean structure on your server.

Tip: That way you can also register just very generic domains and use different subdomains then for different verticals.

That´s all, I hope it´s not too confusing for you but for me it´s working very good that way for several years already.


09-18-2021 01:22 AM #2 vortex (Senior Moderator)

Fab! Tech is my weakest area. In the 40-day tutorial I show a setup that works, but I have heard that cloudflare may be superior. Will link from that lesson to yours.


Amy


Sent from my iPhone using STM Forums


10-05-2021 04:52 PM #3 twinaxe (Senior Moderator)

Quote Originally Posted by vortex View Post
but I have heard that cloudflare may be superior.
In my opinion the 2 biggest advantages of using Cloudflare are that it´s

1. Very easy to setup
2. It´s free

Will link from that lesson to yours.
Great, sounds good


01-18-2022 07:16 AM #4 fors ()

What do I do if the DNS never propagates?

I have tried this setup twice now with different droplets/domains and the IP never changes in the DNS checker. I am 99% everything is setup correctly.

I tried running the Binom script anyway and it seemed to work correctly, not sure what that means


01-18-2022 10:44 AM #5 larsometer (Senior Member)

Can you post a screenshot of your CloudFlare DNS setting? You can blur out parts of your domain and IP.

Just guessing... did you put @ symbol where it says "root" when creating the A record in CloudFlare?

The Binom script has nothing to do with the propagation. The only thing it does is setting up your domains for Nginx and Letsentcrypt.


01-19-2022 07:04 AM #6 fors ()

Click image for larger version. 

Name:	2022-01-19 09_01_28-Window.jpg 
Views:	10 
Size:	27.9 KB 
ID:	25905
Click image for larger version. 

Name:	2022-01-19 09_01_37-Window.jpg 
Views:	24 
Size:	85.2 KB 
ID:	25904
Click image for larger version. 

Name:	2022-01-19 09_02_04-Window.jpg 
Views:	12 
Size:	56.0 KB 
ID:	25906

I must be missing something obvious


01-19-2022 08:22 AM #7 larsometer (Senior Member)

Well the following link shows that propagation did work for most geos. Probably for the remaining geos it will take a bit longer.

--> See for yourself:

https://www.whatsmydns.net/#A/healthbodynews.net


01-19-2022 08:24 AM #8 jeremie (Moderator)

It's done. DNS propagation have been done properly, congrats! The IPs you see on DNS checker are CloudFlare DNS server IPs, which is normal.

You can keep going on the tuto from "To add the domain to the server we just use Binoms auto install script, that way you only need 1-2 little commands and that´s all." Everything before that looks good.


01-19-2022 11:13 AM #9 fors ()

Oh I was expecting the digitalocean server IP to show up for some reason, just shows what a noob I am when it comes to hosting! Then everything was working correctly all the time

Thanks for the help!


08-16-2022 08:55 AM #10 zzr1988 (Member)

@twinaxe Just to confirm we will have two droplets on our digital ocean server one for tracking with Binom and one for landing pages? Also how do we know how much capacity we need is there a way to tell?


08-16-2022 10:50 AM #11 matuloo (Legendary Moderator)

Quote Originally Posted by zzr1988 View Post
@twinaxe Just to confirm we will have two droplets on our digital ocean server one for tracking with Binom and one for landing pages? Also how do we know how much capacity we need is there a way to tell?
Yup, it's better to keep the tracker on a separate droplet/VPS.

The capacity depends on how much traffic you are about to run. When starting out, even the cheapest one should be enough for the landers and you can always upgrade as needed.

Binom recommends the 2GB/1CPU for the starters, that one is going for $14 right now if I'm not wrong. Here is more info on their website: https://docs.binom.org/servers.php


08-16-2022 01:24 PM #12 zzr1988 (Member)

Quote Originally Posted by matuloo View Post
Yup, it's better to keep the tracker on a separate droplet/VPS.

The capacity depends on how much traffic you are about to run. When starting out, even the cheapest one should be enough for the landers and you can always upgrade as needed.

Binom recommends the 2GB/1CPU for the starters, that one is going for $14 right now if I'm not wrong. Here is more info on their website: https://docs.binom.org/servers.php
Thanks for the clarification hope I can solve my click loss issue in my FA thread so I can finally get moving.


08-16-2022 03:12 PM #13 twinaxe (Senior Moderator)

Just to confirm we will have two droplets on our digital ocean server one for tracking with Binom and one for landing pages?
I have everything on one server.

I use a dedicated server from Hetzner because of high volume but if you don´t have that high volume yet you can also run everything on one droplet, just make sure that it has enough power.

Of course you can also use 1 droplet for tracker and another one for landing pages.


08-18-2022 07:08 AM #14 zzr1988 (Member)

Of course you can also use 1 droplet for tracker and another one for landing pages.
I had a warning message saying to install only on a blank server when installing Binom on LEMP ubuntu. I was stuck for hours so I ended up just installing it on a blank ubuntu 20.04 droplet in NYC. I thought it was not possible to install the lp domain on the same droplet. Damn without STM forum I think I can't even get started in affiliate marketing.


08-18-2022 10:57 AM #15 twinaxe (Senior Moderator)

Quote Originally Posted by zzr1988 View Post
Damn without STM forum I think I can't even get started in affiliate marketing.
That´s great to hear


Home > The Newbie Zone >