The Server Sync option allows to sync your Brizy Cloud project on your own infrastructure/server in real time.
API Explorer: https://[your-white-label-dashboard-domain]/api/doc/v2 (to access the correct link please replace [your-white-label-dashboard-domain] with the domain you gave us in the on-boarding process for your White Label setup)
Requirements
- PHP version: 7.4 or higher;
- PHP extensions: json, fileinfo, http
- Webserver: Apache or Nginx
Step 1. Download the zip via API endpoint https://admin.brizy.io/api/doc/v2#get--api-{version}-projects-{project}-sync-download
Step 2. Unpack the ZIP you just downloaded, and inside the folder you'll find a bunch of folders and files.
Step 3. Web Server Configuration
- Apache Configuration
<IfModule mod_rewrite.c>
RewriteEngine on
# --- Redirect from http to https
#RewriteCond %{HTTPS} off
#RewriteCond %{HTTP:X-Forwarded-Proto} !https
#RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# ---
# --- Redirect from non-www to www
#RewriteCond %{HTTP_HOST} !^www. [NC]
#RewriteRule ^ %{REQUEST_SCHEME}://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# ---
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $0#%{REQUEST_URI} ([^#]*)#(.*)\1$
RewriteRule ^.*$ %2index.php?page=$0&%{QUERY_STRING} [QSA,L]
</IfModule>
- Nginx Configuration
If your server uses NGINX webserver software instead of Apache, it will be necessary to setup some configuration rules into nginx.conf.
Nginx provides much more flexibilty in configuration, so it is hard to provide configuration lines that will be working on any webserver. These lines below are just and example on what must be done to get things working.
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /var/www/html;
location / {
# try to serve file directly, fallback to index.development
try_files $uri /index.development$is_args$args;
}
location ~ ^/index\.development(/|$) {
# when using PHP-FPM as a unix socket
#fastcgi_pass unix:/sock/development-fpm.sock;
# when PHP-FPM is configured to use TCP
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.development)(/.*)$;
include fastcgi_params;
# optionally set the value of the environment variables used in the application
# fastcgi_param APP_ENV prod;
# When you are using symlinks to link the document root to the
# current version of your application, you should pass the real
# application path instead of the path to the symlink to PHP
# FPM.
# Otherwise, PHP's OPcache may not properly detect changes to
# your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
# for more information).
# Caveat: When PHP-FPM is hosted on a different machine from nginx
# $realpath_root may not resolve as you expect! In this case try using
# $document_root instead.
#fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME /var/www/html/index.php;
fastcgi_param DOCUMENT_ROOT $realpath_root;
# Prevents URIs that include the front controller. This will 404:
# http://example.com/index.php/some-path
# Remove the internal directive to allow URIs like this
internal;
}
# return 404 for all other development files not matching the front controller
# this prevents access to other development files you don't want to be accessible.
location ~ \.development$ {
return 404
}
error_log /var/log/nginx/project_error.log;
access_log /var/log/nginx/project_access.log;
}
Step 4. Upload the files on your server. The files should be copied to your public HTML directory - this is the directory where your home page is located: 'html', 'public_html', 'www'.
Step 5. Setting Permission for a File or a Folder
Folder permissions should be set to 755, and file permissions need to be set to 644.
Step 6. Open in your web browser: https://www.your-domain.site to begin the install and synchronisation process.
From now on, when you modify something in your Brizy Cloud project and press the Update button, it will get synced automatically on your server.