docs / controller

Controller detailed manual installation

Manual, step-by-step installation.

In case you don’t want to use our automated installation script or you want to install Controller to a special/custom place (e.g. docker) follow the manual instructions below.

Download and extract in your custom folder / public_html of your choice:

cd /path/to/zcloud
wget https://repo.nixpal.com/controller/zcloud-controller-latest.zip
unzip zcloud-controller-latest.zip
rm -f zcloud-controller-latest.zip

Database Setup.

Assuming you created a database and a user, import the database:

mysql -u<DB_USER> -p <DB> < ./db.sql
$ rm -f ./db.sql

Apache configuration

Set your virtual host’s document root to point to folder of ZCloud controller. e.g.

<VirtualHost *:80>
DocumentRoot "/path/to/zcloud/"
DirectoryIndex index.php
ServerName <server_hostname>
<Directory "/path/to/zcloud/">
Options All
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>
<VirtualHost>

Reload apache after creating the new virtualhost.

Nginx configuration

Sample nginx configuration

server {
server_name zcloud.example.com;
listen x.x.x.x;
root /home/zcloud/public_html/public;
index index.html index.htm index.php;
access_log /var/log/nginx/zcloud.example.com_access_log;
error_log /var/log/nginx/zcloud.example.com_error_log;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;

location ~ \.php$ {
try_files $uri =404;
fastcgi_pass localhost:8001;
# fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
listen x.x.x.x:443 ssl;
ssl_certificate /home/zcloud/ssl.combined;
ssl_certificate_key /home/zcloud/ssl.key;
}

Certificate Configuration

The Controller needs a TLS certificate. With Let’s Encrypt, for example:

certbot --apache

Controller Configuration

Copy the config file and Edit:

cp /path/to/zcloud/.env.example /path/to/zcloud/.env
nano /path/to/zcloud/.env

Set the appropriate variables:

APP_NAME=zCloud
APP_ENV=local
APP_KEY=
APP_DEBUG=false
APP_URL=https://<server's hostname>
ZCLOUD_LICENSE="<insert your zCloud-Controller license key>"
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=<database name>
DB_USERNAME=<database user>
DB_PASSWORD=<user password>
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

MAIL_DRIVER=smtp
MAIL_HOST=mail.example.com
MAIL_PORT=25
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=zcloud@example.com
MAIL_FROM_NAME="zCloud"

Finalizing Controller installation

While you’re in /path/to/zcloud/

php artisan key:generate
composer install --no-dev

Setting the appropriate files/folders permissions for the web server

sudo chown apache: /path/to/zcloud -R

Now go to https://<server’s hostname>/.

Default username is admin@example.com and password admin_!@

E-mail notifications and monitor cronjob

Create a cronjob that runs every minute:

* * * * * cd /path/to/zcloud && php artisan schedule:run

Caveats – Tips

PHP configuration

In case you have more than 1000 zones in a server or more, you need to modify – increase Controller’s php.ini max_input_vars which defaults to 1000 to something larger (10000 for example).

; How many GET/POST/COOKIE input variables may be accepted
max_input_vars = 10000

SELinux configuration

setsebool -P httpd_read_user_content 1
setsebool -P httpd_can_network_connect 1
setsebool -P httpd_can_network_connect_db on
semanage fcontext -a -t httpd_sys_rw_content_t "/path/to/zcloud(/.*)?"
restorecon -RFv /path/to/zcloud/

Finish setup in web interface

Now go to https://<server’s hostname>/. In our example it’s https://controller.nixpal.com

Default username is admin@example.com and password admin_!@

You can start creating a Cluster. For example “Nixpal” and then Adding servers to this Cluster.

We recommend creating 2, or 3 or 4 DNS Servers Nodes first, and then add all of your Web Servers (Agents).