Deployment of front server

The front server is responsible for hiding the main network server, caching landing static contents and creating SSL certificates for parked domains. Useful for an affiliate network or merchant. Useless for the arbitration team, which does not use the site repository.

Technical requirements

You will need an additional virtual server. A server with the minimum characteristics available from your provider is suitable. As usual, these are 1-2 virtual processors, 500-1000 MB of RAM, 5-10 GB of HDD space. The front server does not have a significant load on the RAM and the processor. The main load falls on the network, so choose a tariff without strict traffic limits. Servers like this can be found in the "Promo" section of your provider.

  • OS: Debian 10 without control panel
  • Processor: minimal - 1 virtual processor, recommended - 2
  • RAM: minumal - 500 МБ, recommended - 1 GB
  • HDD: minimal - 5 GB, recommended - 10 GB and more

Setting up server

The setup must be done after the main platform is deployed and configured. In the "Control" section, the "Sites" subsection, copy the global API key from the "Technical settings" block, it will be required for deployment.

Connect to the server via SSH as root and run the command like this:

wget https://cpa.st/setup/front.sh
bash front.sh r.domain.com domain.com siteapikey

You'll need AlterCPA site storage domain, home domain and generic site API-key to setup the server. Use them instead of r.domain.com, domain.com and siteapikey. Like:

wget https://cpa.st/setup/front.sh
bash front.sh altercpa.site r.altercpa.site 26r2vb2k7d9mwxklnm1wc6vkck1wof6i

Important! You need to use precisely system domain, linked to your site storage, not a parked one! It usually looks like r.domain.com.

The installation process is automatic, it will take a couple of minutes. At the end of the installation process, the server is ready for operation.

Additional server setup

Add IP main domains to the hosts file. This setting is recommended for speeding. It is performed manually after installation. Required if the main server is behind CloudFlare.

On the server on behalf of root, run the command:

nano /etc/hosts

Add to file:

12.34.56.78 domain.com r.domain.com

Where instead of 12.34.56.78 will be the IP address of your primary server, and the domains you have already specified when setting up.

System settings

Go to "Control - Settings - Sites". Specify the IP address of your server in Parking IP fields in blocks forredirect, landing and prelanding. In the "Technical settings" block, check the box "Using a front server or Private Flare".

Tell the affiliates working with your system that all existing parking domains must be transferred to a new address, and new domains can immediately park with this address.

Setting up the main server

After installation, the generation of SSL certificates switches to the front server and it must be turned off on the main one.

Run on behalf of root on the main server:

crontab -e

And remove the line containing webssl. Save (Ctrl+O, Enter) and exit the editor (Ctrl+X).

After transferring all parked domains to a new address, delete the file with additional certificates and restart the server:

rm -f /etc/nginx/conf.d/webssl.conf
service nginx restart

Caching

The front server is caching static data from the main server to accelerate requests. To reset the cache, connect to the front server on behalf of root and execute the command:

./uncache