Setup in manual mode

This manual will help you deploy the system in manual way. We recommend that you deploy the system according to another instruction, because it is suitable for almost any network configuration.

Preparing to deploy

For deployment, you will need to prepare the following components yourself:

  1. Dedicated or virtual server on clean Debian 10 without control panel. Exaclty Debian 10. Exactly clean and without control panel. This requirement is critical for the operation of the system; we do not guarantee operation on a different server configuration. Shared hosting will not work.
  2. Domain for the control panel and internal services. We recommend that you use a second-level domain, since we need several subdomains to work. Installing the control panel on a subdomain is not required - you can replace the login form with your landing page on the main domain.
  3. Licence of AlterCPA with any lifetime. When purchasing a license, you need to specify your server IP address and primary domain.
  4. Ability пto use the SSH client and FTP client, as well as the clients themselves. Putty is suitable as an SSH client for Windows. Terminus can be used for MacOS. Filezilla recommended as FTP client. MacOS users dont need to install it from the AppStore, simply download it for free from the official website.

Setting up the domain

You need to direct the domain to the purchased server. To do this, you need the IP address of the purchased server. Most likely, it was sent to your e-mail at the time of purchase or is displayed in your server’s personal dashboard.

In the settings of the domain’s DNS servers, select the option "Use DNS servers of the registrar" (or similar). If your registrar does not provide free DNS servers, we recommend using DNS servers from CloudFlare (without a proxy, only DNS).

In the settings of the DNS zone (namely, the DNS zone or DNS records, and not the list of DNS servers themselves), you need to specify the following records. You can use any of the options below, they are interchangeable and depend solely on the capabilities of your registrar. Instead of 12.34.56.78, use the IP address of your server. The list shows respectively the name of the record, the type of record and value.

Case 1. Optimal for most registars

@ A 12.34.56.78
www CNAME @
pms CNAME @
r CNAME @

Case 2. Works anywhere.

@ A 12.34.56.78
www A 12.34.56.78
pms A 12.34.56.78
r A 12.34.56.78

Setting up the server

Before setting up the server, be sure to wait a while to complete the domain setup. Usually, changing DNS servers takes about a day, setting up records takes about an hour.

Connect to your server via SSH as root. Usually, the root password is sent to the e-mail after the installation of the server on the provider side is completed. In some cases, when you first log in, you need to change the password to a new one. Use a strong password no shorter than 16 characters. If possible, study the issue of SSH connectivity using a certificate and use your certificate when ordering a server. Some servers do not allow you to connect as root using various tricks, so after connecting you need to run the command:

sudo -i

After connecting to the server as root, execute the server installation and configuration commands. Instead of domain.com use your domain, linked to the license.

wget https://cpa.st/setup/d10n.sh
bash d10n.sh domain.com

Wait a few minutes until the installation script completes. In some cases, the script may show errors in obtaining SSL certificates if the domain did not manage to bind. You don't need to run the installation script again, just repeat the certificate request according to the server setup instructions.

At installation finishes, you need to get the server settings. To do this, run the command:

cat config.txt

And it will show the settings for access to FTP, MySQL and the system database. You will need them later.

Setting up the license

Download your license file altercpa.txt from the "License" section of your account. Please note that you need to manually update the license file each time you renew the license or change its settings!

/var/www folder.

Simply copy altercpa.txt file to this folder. Don't copy it into your domain folder!

Setting up control panel

Go to the "Download" section of your personal account and download the test version of AlterCPA Pro for PHP 7.2. The test version is almost always better than the stable one, because interesting innovations appear in it, and it is quite stable in most cases.

Unzip the downloaded archive to any folder convenient for you. Open the work folder of the unzipped archive and copy it's contents to your main domain folder via FTP. ВIn rare cases, FTP transfer may damage files. In case of such errors, open the Filezilla settings and in the "Transfers - FTP: File Types" section select the default transmission type - binary. After that, copy all the files from the work folder again, overwriting the existing ones.

Open your primary domain in a browser. If everything went well, you will be asked to specify the settings for connecting to the database:

  • Server: localhost
  • Database: cpa
  • User: cpa
  • Password: you got it from config.txt file

After specifying this data, you will be asked to create the chief administrator. We recommend that you specify a valid mail and a strong password. The administrator has full access to any operations with the system.

Initial system setup

Immediately after installation, you must configure the basic system settings. To do this, go to the "Control - Settings" section, in which all the manipulations with the basic settings are carried out. In the "Basic Settings" section, specify the name of your network and contact E-mail. In the "Appearance" section, select a color scheme for the control panel. This is the end of the most important and critical settings, let's move on to the technical settings.

Further in the text, instead of domain.com, use the main domain of your network. That is, if your network is installed on altercpa.site, then any references to domain.com for you will mean altercpa.site, and r.domain.com will accordingly be converted to r.altercpa.site.

You will need to make small changes to the sections "Basic", "Sites", "Advanced", "Finance", "Database" and possibly "Datasets". Also open for editing the config.php file from the r.domain.com folder of your server via FTP.

Section "Basic"

  1. It is recommended to check the box "Prohibit user registration" before the end of the procedure for setting offers. Also, this checkbox will be useful for a private network.
  2. Enter the details of your mail domain (we recommend Yandex.Connect). If its use is not planned, do not make any changes to the mail settings and use the “hack” described below.

Section "Sites"

  1. Check all the checkboxes "Allow parking" and in the field "IP parking" enter the IP address of your server.
  2. Check all the checkboxes "Use SSL"
  3. Copy the value of the constant CONTROL from config.php file to the "Control key" fields
  4. Put the value from "Global API key" field to the APIKEY constant in config.php file

Section "Advanced"

  1. Check the box "Use ClickServer", it is recommended for any work with sites on your server.
  2. Copy the field "Key" from the ClickServer section to the CLICKSRV_KEY constant in config.php file
  3. In config.php file uncomment the line (remove # symbol in the beginning) with the CLICKSERVER constant.

Section "Finance"

  1. Select the main internal currency of the system in which payments will be calculated.
  2. After choosing a currency, click the "Update" button in the list of currencies.

Section "Database"

  1. We recommend selection MaxMind GeoLite English geobase as the best one.
  2. Enable additional databases if necessary

Section "Datasets"

In this section, you may be interested in the items "Categories of offers" and "Methods of withdrawal of funds".

Hack for mail support

We recommend using a full-featured mail server for working with email, for example Yandex.Connect. But if necessary, you can send messages to users directly from the server. To do this, install and configure Exim. Log in to the server via SSH and run:

apt install exim4

Upon completion of the installation, Exim4 must be configured. To do this, run:

dpkg-reconfigure exim4-config

In the dialog box that opens, select the Internet site operation model, on the second and fourth screens specify your main domain, leave the rest of the settings unchanged.

Further steps

  1. Read the "Working with platform" section of the manual.
  2. No, we are serious: read the section "Working with platform" of this manual, you really need it in your work.
  3. If necessary, check out the other "Deployment" section guides if you want to make any special changes to your server. Usually, this is not required and everything will work by itself.