Controller

Step by Step Installation

Controller Installation

Bellow is a generic installation guide. Controller can be installed in a cloud/bare metal server, or shared hosting package.

Click here for detailed installation from scratch in a minimal CentOS / AlmaLinux / RockyLinux / EL 8.x Server.

Requirements

  • Apache (or Nginx)
  • PHP 7.3+ (with ionCube loader)
  • MySQL
  • Composer

Automated installer

Automated installer scans environment, checks if it’s a cPanel/DirectAdmin server or Apache/Nginx standalone servers and acts accordingly.
You need to run it within the public_html and with the user’s credentials.
You need to create:

  • the user (e.g. a cPanel account)
  • the MySQL database
  • the DB user and grant all permissions to the DB user

Download and execute

cd /path/to/public_html
wget -O - https://repo.nixpal.com/controller/install.sh | bash 

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

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 

Import 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;
} 

Enable SSL

e.g. Let’s encrypt

certbot --apache 

Configuration

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 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 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 (5000 for example).

; How many GET/POST/COOKIE input variables may be accepted
max_input_vars = 5000 
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/ 

Questions? Issues?

Scroll to Top