Site storage for AlterCPA Lite, One and Red

The installation of the site storage is fully automatic. The storage holds the sites of your tracker (whites, blacks, landings and prelandings), serves them on parked domains and issues SSL certificates for those domains itself. You prepare a server and a domain and run one command from the control panel on the server, and the installer does everything else by itself.

Preparing to deploy

  1. Control panel of AlterCPA, installed and working. The storage connects to it and needs no license of its own.
  2. Server on clean Debian 13 without a control panel, with its own IPv4 address. Ports 22, 80 and 443 must be open. CPU and memory are not critical, but there must be enough disk space for your sites. The server must be a separate one: the storage will not install on the panel’s server or on a front server.
  3. Domain for the sites. The panel recommends parking at least one domain on the storage: it is needed to preview the sites.
  4. SSH client: PuTTY for Windows, the built-in Terminal for macOS.

Setting up the domain

Point the domain for the sites to the storage server. The domain of the control panel stays on its own server. In the DNS zone of the domain (the zone records, not the list of DNS servers) remove the extra A, AAAA and CNAME records and add one A record. Replace 12.34.56.78 with the IP address of your server.

@ A 12.34.56.78

If it is a subdomain, enter its name instead of @. The www subdomain is not supported, so it needs no record. There is no need to wait for the record to start working: the certificate will be issued by itself once the domain points to the server.

Installation

  1. Connect to the server over SSH as root. If the provider does not let you log in as root, run this command after logging in:
    sudo -i
  2. In the control panel, open the “Sites” section and click the “Settings” button. In the “Site storage” form, copy the command from the “Setup command” field. All the data it needs is already filled in. The command looks like this:
    wget -q https://cpa.st/setup/track.sh && bash track.sh domain.com 1-q1w2e3r4t5y6u7i8o9p0
  3. Paste the command into the SSH window and press Enter. The installer asks no questions. Keep the terminal open until it has finished.
  4. Wait a few minutes. At the end the installer prints the storage data, including the password for SFTP access, and the line “Done.”. The server does not need a reboot.
  5. If the installation stopped with an error, remove the cause and run the same command again.

System settings

The installer passes the address and the key of the storage to the panel itself. Refresh the “Sites — Settings” page. In the “Site storage” form the “Site storage is set up and active” box will be checked, and the “Control URL” and “Control key” fields will be filled in.

Now add the domain in the “Domains” section and click the “Check” button. The storage gets a domain after the check and issues a certificate for it, so HTTPS does not appear at once. When the domain works, enter it in the “Primary domain” field of the “Site storage” form and save the form. The panel will open the sites on this domain. Point the domains that were parked earlier to the IP address of the new storage. The panel shows it in the “Domains” section, in the “Your parking IPs” line.

Setting up storage synchronization

If you have several storages, you only need to upload the sites to one of them, the main storage. Every three minutes it copies all its sites to the other storages, the satellites. The main storage can be any of your own storages installed by this guide, and you make the others its satellites. In AlterCPA Lite the main storage can also be the central storage of the tracker itself, that is, the panel’s server. The tracker does not need a storage of its own, though: the sites can live on a separate server alone. AlterCPA One and Red have no central storage, only yours.

  1. Install a satellite on a separate server the same way as an ordinary storage, but add the word satellite to the end of the command from the panel. If the command already ends with the word teamwork, replace it with satellite. The panel does not learn about the satellite, and the sites are still uploaded to the main storage. The main storage logs in to the satellite over SSH as the user wsvr with a password, so port 22 must be open and password login must be allowed.
    wget -q https://cpa.st/setup/track.sh && bash track.sh domain.com 1-q1w2e3r4t5y6u7i8o9p0 satellite
  2. At the end of the installation the satellite prints a line with its IP address and its password. The same line is saved on the satellite in the file /root/config.txt. The line looks like this:
    12.34.56.78 p0o9i8u7y6t5r4e3w2q1
  3. Connect to the main storage over SSH as root and open the file with the list of satellites:
    nano /root/rsync-nodes.txt
    Add the satellite’s line to it: the IP address, a space, the password. Each satellite goes on its own line. Save the file (Ctrl+O, then Enter) and close the editor (Ctrl+X).
  4. Turn on copying on the main storage. To do this, run the command:
    crontab -e
    If the system asks which editor to open, press Enter: nano opens. If the file that opens has a line with rsync-push that begins with the # sign, remove the sign. If there is no such line, add it:
    */3 * * * * bash /root/rsync-push >/dev/null 2>&1
    Save the file and close the editor the same way as in the previous step.

In a few minutes the sites of the main storage will appear on the satellites. Copying goes one way: files that are not on the main storage are deleted from the satellite. So upload the sites to the main storage only. The server settings and the certificates are not copied, each storage issues its own certificates.

A domain can be parked on the address of any storage. To make the panel show the addresses of all the storages for parking, list them separated by commas, the main storage’s included. If the main storage was installed by this guide, open the “Sites — Settings” page, enter the addresses in the “Parking IP” field of the “Site storage” form and save the form. In AlterCPA Lite, if the main storage is the panel’s server, the administrator enters them in the “Parking IP addresses” field of the “Tracker settings” block in “Control — Settings — Advanced”. Check new domains in the “Domains” section with the “Check” button, as you did after the installation.

Further steps

  1. Keep the output of the installer: it holds the password for SFTP access to the storage, the login is wsvr. The same data is on the server in the file /root/config.txt.
  2. The code of the storage updates itself: every hour the storage checks with the panel and downloads the new version if one is out.
  3. To hide the address of the storage and protect it from complaints, place a front server in front of it. The article “Front server for AlterCPA Lite, One and Red” explains how.