Određeni dijelovi stranice nisu prevedeni, ispričavamo se za neugdnosti

Builder installation / update

Table of contents

Podrška

Our team install Site.pro builder for free for new clients with a paid license. Just let us know by creating a ticket and providing us needed login details.

You can find login details which will be needed for builder installation below.

  • If using cPanel:
    • preferrably ROOT access to server https://[your-cpanel-host]:2087 (where username = "root").
    • Access to cPanel account https://[your-cpanel-host]:2083 where you want site builder to be installed. It can be a separate clean account or already used account — then builder can be installed on sub-domain or addon domain.
  • If using Plesk:
    • preferrably ROOT or Admin access to server https://[your-plesk-host]:8443.
    • Access to Plesk account where you want site builder to be installed.
  • Other:
    • ROOT access to server. It can also be a clean server — then our team will install all required software (Apache, PHP, MySQL) as well.
Important: Please white-list our IP address 88.119.136.57 on your server if firewall is blocking connections from it.

Server

Requirements:

  • Apache 2.2 (or newer) (modules: rewrite (rewriting from .htaccess must be enabled), headers)
  • PHP 5.3.6 (or newer) (extensions: gd (version 2+), exif, sqlite, pdo, pdo_mysql, pdo_sqlite, json, curl, mbstring, iconv, xml, openssl, zlib, zip)
    Note: Published websites require PHP 5.3.6 (or newer) and Apache 2.2 (or newer) too.
  • MySQL 5.5 (or newer)
  • ionCube Loader (newest version possible) ionCube install instructions can be found at ionCube site: http://www.ioncube.com/loaders.php
    The recommended way of installing ionCube loader is by downloading loader wizard loader-wizard.zip, extracting it to web-servers document root and opening it via browser and then just following install instructions from there.
  • Web accessibility through domain (sub-domain). Local builder installations are not supported. Make sure that you specified correct domain (sub-domain) for builder. It must be accessible publicly on the WEB.

Recommendations for builder server:

[Hardware]
CPU: 2GHz
RAM: 2048MB
Storage (HDD or SSD): 20 GB (it can vary depending on number of customers using site builder) (see how the space can be optimized).
(This is recommended hardware requirements, depending on concurrent user count you might be OK with half or even less)

[OS]
Ubuntu / Debian / CentOS / Windows (should work on any other operating system)

Important:
Make sure PHP xdebug extension is not installed.
For CentOS owners:
  • You will possibly need to enable curl, sockets, ... (network access) for web server. This can be done by executing command: setsebool -P httpd_can_network_connect on
  • If ionCube is not working there might be problems with SELinux permissions. To fix that execute command: ls -alZ /usr/lib64/php/modules/ to list all php modules (command part /usr/lib64/php/modules/ is a path where you installed ionCube loader, so you need to set it to where you installed it), and check if ionCube loader SELinux context matches other php modules, if not, set it to match using this command:
    chcon system_u:object_r:lib_t:s0 /usr/lib64/php/modules/ioncube_loader_lin_5.3.so (command part system_u:object_r:lib_t:s0 is the context string, so you need to change it to match other php modules).

Nginx if used instead of Apache

Configuration for builder:

If you want to use NGINX Web Server instead of Apache for builder installation you will need to configure separate virtual host (server configuration) for it. Ex. if your builder domain is some.builder.domain and builder is installed at /home/builder/public_html you could set server configuration to something like this:

... # click to expand
Note:
If you change "builderSitePathPrefix" configuration option then you need to replace it ("sitepro" string) here too. Also this is only one of possible configurations, your server might require it to be different (for ex. line fastcgi_pass 127.0.0.1:9000; might be different on your server) so you will need to adjust it.

Configuration for published websites:

If you want to use NGINX Web Server instead of Apache for published websites you need to configure separate virtual host (server configuration) for every website you will publish to. Ex. if web-sites you want to publish to domain is some.site.domain and it's document root is at /home/site/public_html you could set server configuration to something like this:

... # click to expand
Note:
If you change "builderSitePathPrefix" configuration option then you need to replace it ("sitepro" string) here too. Also this is only one of possible configurations, your server might require it to be different (for ex. line fastcgi_pass 127.0.0.1:9000; might be different on your server) so you will need to adjust it.
Show configuration example for Plesk

Plesk configuration example:

  • create file on Plesk server /usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php
  • copy contents of default file /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php to file you created
  • add the following content somewhere to the middle of the file (but be careful not to add it within some existing IF rule):
    <?php if (is_dir($VAR->domain->physicalHosting->httpDir.'/sitepro')): ?>
    location ~ /(\.ht|error_log|php_errors\.log)|^/sitepro/(vendor/|src/) {
            deny  all;
    }
    location ~ ^/ {
            index index.php index.html;
            try_files /sitepro$uri /sitepro$uri/ /sitepro/index.php?$args;
    }
    <?php endif; ?>

This template will add Site.pro required rules to all clients' sites nginx configuration if the site was published with Site.pro builder.
You can read more about Plesk template files here:
https://docs.plesk.com/en-US/onyx/advanced-administration-guide-linux/virtual-hosts-configuration/changing-virtual-hosts-settings-using-configuration-templates.68693/.

Installation

  1. Download site builder archive and extract it to your virtual host www folder:
  2. Open link in your browser (ex.: http://your-builder-domain.com/installer/) and follow instructions from there.
    Installation script can also be executed using CLI for automated installs (without requiring user interaction):
    php installer/index.php "/installer?host=[builder-hostname]&dbHost=[database-host]&dbName=[database-name]&dbUser=[database-user]&dbPass=[database-password]&cfgApiUser=[API Username from brand]&cfgApiPass=[API Password from brand]&cfgBrandId=[Brand ID]"
    Note:
    When running CLI installer will verify PHP CLI configuration and not the actual PHP configuration that will be used for running builder. Make sure they match.
  3. When installation completes, delete folder installer.
  4. Setup builder CRON. This will help you to optimize builder used space and keep builder up-to-date.

Video guide

Update

  1. Login to builder server console per SSH.
  2. Run the following command:
    cd [BUILDER_DIR] && php index.php /api/update-builder
    where replace "[BUILDER_DIR]" with a real path where you have builder installed.
  3. Note:
    If you have multiple PHP versions on server and PHP CLI version differs from PHP WEB version used by builder then specify correct PHP executable in CRON command. For example:
    cd [BUILDER_DIR] && /usr/bin/php7 index.php /api/update-builder
Note:
If due to some reason update fails you can try to update builder manually. After manual update is complete update process described in this part should start working.

Migration to version 4.x.x

In order to migrate your current builder installation which is of version 3.x.x you need to execute manual update with builder archive of version 4.x.x. (Make sure you execute all steps).

Note: If you need help in migration to new builder please contact us by creating a ticket and specifying details about migration.
Our team will need access to your server. You may send it at once in the ticket (check preferable access credentials).

After migration to version 4.x.x the new builder will become default for all clients but the client will always be able to return back to builder v3. After switching to old builder it will be loaded with URL:
"http://your-builder-domain.com/v3/".

Note: Websites in builder v4 and v3 are not synchronized — if the client builds website in v4 and decides to return to v3 then he will see his old website which he had before migration to v4. Moreover if the client returns to v3 his current project of v4 will be removed.

For those who had custom templates and/or custom plugins

After migration all custom templates and plugins will be moved to new builder and will automatically be converted so that their structure correspond to new builder version. After that custom templates and plugins will no longer be available on version v3. In order to bring them back to old builder you need to:

  • copy all folders of your custom templates from "templates" to "v3/templates"
  • copy all folders of your custom plugins from "plugins" to "v3/plugins"

Warning:

  • When opening builder for the 1st time after migration it may take up to several minutes for builder to load. During this time builder will convert all custom templates. If builder window accidentally times out then just refresh it to make the process continue.
  • After migration we recommend you to check your custom templates whether they have been converted properly. Possibly some fixes will be required.

HTTPS

In order to run builder under HTTPS protocol you need to take the following steps:

  • Update builder domain in your brand from "your-builder-domain.com" to "https://your-builder-domain.com".
  • Open file "config.json" located in your builder web-root directory and update parameter "siteProApiUrl" to be also with "https://".

Extra configuration

You can set extra options for your builder by modifying file "config.json" located in your builder web-root folder:

  • String — Plans separated by comma for which builder will not work default: -
  • String — Opposite to "disabledHostingPlans". If specified "disabledHostingPlans" will be ignored default: -
  • String — Message to show when hosting plan matches the one from specified in "disabledHostingPlans" option or when hosting plan is not included in plans specified in "enabledHostingPlans" option (used together with "disabledHostingPlans" or "enabledHostingPlans" accordingly). The value is multilingual.* default: default sentence(1)
  • String — Yandex Metrika ID for builder default: -
  • Boolean — Use Yandex Metrika ID only in public demo builder default: false
  • Object — Object adding extra buttons to builder toolbar - default: example below(2)
  • Boolean — Defines whether to use FTP with SSL encryption during publishing. default: false
  • String — Builder UI theme ID to use (currently only "modern" is available). Will be ignored if "themeUrl" is set. default: -
  • String — URL to css file to change builder UI style. default: -
  • String — Google.com Maps API key. Required to enable Google Maps plugin (get it from here). default: -
  • String — Google.com Fonts API key. Required to enable Google Fonts feature (get it from here). Note: Google Fonts also works with parameter "googleMapsApiKey" if set. default: -
  • Boolean — If true template usage statistics will be logged to database (enable only if you are using automated builder updates). default: false
  • Boolean — If true will show forced HTTPS port option in builder settings dialog. default: false
  • Boolean — If true will disable URL rewriting for published websites. default: false
  • Boolean — If true then forced HTTPS option will be enabled in new websites by default. default: false
  • Boolean — If true then forced redirection option will be enabled in new websites by default. default: false
  • Boolean — Forced redirection option chosen by default (1 - redirect from www to non-www, 2 - redirect from non-www to www). default: 1


  • (1) — "The software is not available for your hosting plan."
  • (2) — example shows how to add two extra buttons in builder toolbar:
    "ui" : {
        "toolbars" : {
            "control-toolbar-cont" : {
                "items" : [
                    {
                        "name" : "Prices",
                        "img" : "/path/or/url/to/prices.png",
                        "url" : "http://yoursite.com/prices",
                        "order" : 21
                    },
                    {
                        "name" : "Domains",
                        "img" : "/path/or/url/to/domains.png",
                        "url" : "http://yoursite.com/sign-up",
                        "order" : 22
                    }
                ]
            }
        }
    }
    All default builder buttons have orders multiple to 20, that is 20, 40, 60 etc.
    Parameters "name" and "url" are multilingual (please see explanation below).
  • * — Multilingual value can be either a string like:
    "disabledHostingPlansMessage": "My message"
    or an object containing values for multiple languages like:
    "disabledHostingPlansMessage": {
        "en": "My message",
        "it": "Il mio messaggio"
    }

CRON available since version 3.7.280

Setup CRON to be executed automatically every minute:

  1. Run command crontab -e to open CRON editor.
  2. Append this line at the end:
    0 0 * * * cd [BUILDER_DIR] && php cron.php
    where replace "[BUILDER_DIR]" with a real path where you have builder installed.
  3. Save new CRON.
Notes:
  • CRON setup mechanism can vary from server to server. The command above shows standard CRON setup in server console.
  • If you have multiple PHP versions on server and PHP CLI version differs from PHP WEB version used by builder then specify correct PHP executable in CRON command. For example:
    * * * * * cd [BUILDER_DIR] && /usr/bin/php7 cron.php

Currently CRON includes the following tasks:

  • builder update (run once per day) — This cron task keeps builder always up-to-date.
  • temporary/old files cleanup (run twice per day) — during builder work it accumulates some garbage (temporary/old files) which can take a lot of space with time. This cron task keeps builder clean and space optimized.
  • free disk space checking (run every 5 minutes) — This cron task checks free disk space the builder is running on. Once the disk is full it disables builder and shows corresponding message for clients. This is important because during lack of free space builder can work unpredictably and even damage clients' site data used by builder. We recommend to sometimes check free disk space on builder server and ensure that there are at least 2 GB available.
Despite the fact CRON does not execute tasks every minute, we recommend to setup it to run every minute anyways. If cron.php is executed and no task is taken that exact time then the script stops. This ensures cron mechanism performance optimization.

Cleanup available since version 3.7.263

This method is deprecated in version 3.7.280 or higher. Please use CRON method instead.

During normal use of builder, temporary files are being created, and after some time they might start using a lot of disk space.
You can use this CRON to regularly (ex. daily) cleanup those files:

  1. Run command crontab -e to open CRON editor.
  2. Append this line at the end:
    0 0 * * * cd [BUILDER_DIR] && php index.php /cron/cleanup/temp-files
    where replace "[BUILDER_DIR]" with a real path where you have builder installed.
  3. Save new CRON.
Note:
If you have multiple PHP versions on server and PHP CLI version differs from PHP WEB version used by builder then specify correct PHP executable in CRON command. For example:
0 0 * * * cd [BUILDER_DIR] && /usr/bin/php7 index.php /cron/cleanup/temp-files

Auto update

This method is deprecated in version 3.7.280 or higher. Please use CRON method instead.

Setup CRON to be executed automatically in specific periods of time (ex. every day):

  1. Run command crontab -e to open CRON editor.
  2. Append this line at the end:
    0 0 * * * cd [BUILDER_DIR] && php index.php /api/update-builder
    where replace "[BUILDER_DIR]" with a real path where you have builder installed.
  3. Save new CRON.
Note:
If you have multiple PHP versions on server and PHP CLI version differs from PHP WEB version used by builder then specify correct PHP executable in CRON command. For example:
0 0 * * * cd [BUILDER_DIR] && /usr/bin/php7 index.php /api/update-builder

Manual update

  1. Download site builder archive and extract it to builder installation folder overwriting all files.
    Important! Do not delete files before extraction:
  2. Execute command:
    cd [BUILDER_DIR] && php index.php "/api/update-builder?skip_extract=1"
    where replace "[BUILDER_DIR]" with a real path where you have builder installed.
    Note:
    If you have multiple PHP versions on server and PHP CLI version differs from PHP WEB version used by builder then specify correct PHP executable in when executing this command.
    For example:
    cd [BUILDER_DIR] && /usr/bin/php7 index.php "/api/update-builder?skip_extract=1"
  3. Delete installer folder (if it exists).

Changing PHP version

If you change PHP version with already installed builder then you will need to manually update builder afterwards (see documentation) in case if PHP version changed range (from the list of PHP versions ranges specified above).

Warning:
When updating PHP version from PHP 5.* to 7.1.* and manually updating builder then you may start getting warnings about missing "mcrypt" PHP extension when opening builder. To fix this issue open builder configurational file "config.json" and add parameter: "useOpenSSL": true, anywhere in the middle.