Administration of AUTOM8N plugin

The end user and administrator has an intuitive UI for managing domains hosted on cPanel and other settings

AUTOM8N does not require constant maintenance .It is meant to do things on its own with input from cPanel end users

Quick Reference of scripts for sysadmins

# Enable or disable the plugin .
/opt/nDeploy/scripts/ disable
/opt/nDeploy/scripts/ enable

# Automatically fix all errors.Can be run if you notice nginx config error or php error etc
# Following will regenerate all config and restart associated services. Use force only if normal run does not fix
/opt/nDeploy/scripts/ force  # force regenerate
/opt/nDeploy/scripts/ autofix # fix php-fpm app server issue

# A best effort to switch as many websites as possible to native nginx
# See file /opt/nDeploy/conf/appsignatures.yaml for switching logic
# Add username to /opt/nDeploy/conf/auto_config.exclude to exclude a specific user

#Install various application servers

#Install netdata monitoring

# Restart application server .note that Passenger apps gets restarted with nginx
systemctl restart ndeploy_backends  # PHP

# Retart cluster file syncing service
systemctl restart ndeploy_unison

# Adding/removing application servers
/opt/nDeploy/scripts/ [add|del] backend_category backend_name backend_path

# Adding/removing application template (generic)
/opt/nDeploy/scripts/ [add|del] [root|cpanelusername] [main|subdir] [backend] [templatefilename] [quoted description]
# Examples
/opt/nDeploy/scripts/ add root main PHP 5001.j2 "Wordpress"
/opt/nDeploy/scripts/ add root subdir PHP 5001_subdir.j2 "Wordpress in subdir"
/opt/nDeploy/scripts/ add cpanelusername main PHP 5001.j2 "Wordpress"
/opt/nDeploy/scripts/ add cpanelusername subdir PHP 5001_subdir.j2 "Wordpress in subdir"

Config Generation logic and customizations

Config generation is based on Templates and YAML settings ( Jinja2 templating engine and YAML settings ) For generating a single nginx vhost following files are parsed in order .The customization filename are mentioned beside them in brackets If the file mentioned in brackets is present, it is used instead of the AUTOM8N package provided one A Sysadmin mostly only need to add /edit application templates and this use minimum template logic for easy manipulation

/opt/nDeploy/domain-data/ # User settings for domain
# if above file is not present ,it is created with default settings from
/opt/nDeploy/conf/domain_data_default.yaml  # ( plan/package based customization can be done from WHM UI )
/opt/nDeploy/conf/domain_data_suspended.yaml # ( /opt/nDeploy/conf/domain_data_suspended_local.yaml )

# Following file generate /etc/nginx/sites-enabled/
/opt/nDeploy/conf/server.j2 # ( /opt/nDeploy/conf/server_local.j2 )

# The application template defined in domain_data setting file is used for generating /etc/nginx/sites-enabled/

# Default vhost template
/opt/nDeploy/conf/default_server.conf.j2 # ( /opt/nDeploy/conf/default_server_local.conf.j2 )

Layer7(Application layer) DDOS mitigation

AUTOM8N integrates for a secure firewall and acting as a SYNPROXY for Layer7 SYN Flood protection

Additionally Nginx DDOS mitigation will setup rate limits on a per IP address and per vhost basis and ensure the connection timeouts are fine tuned for mitigating attacks

Both the SYNPROXY and NGINX mitigation systems can be activated from WHM AUTOM8N User Interface

SYNPROXY need prior setup of the FireHol firewall to work .It is incompatible with CSF firewall. So during an attack you must disable CSF and activate FireHol from the AUTOM8N WHM UI

cd /opt/nDeploy/conf/nDeploy-firewall/
ansible-playbook -i ./hosts firewall.yml --extra-vars "ansible_port=22"
# ansible_port is the SSH port on the server , if you give it wrong you will be locked out!

#optionally you can customize the firewall and redeploy
cp -p /opt/nDeploy/conf/nDeploy-firewall/roles/firehol_deploy/templates/firehol.conf.j2 /opt/nDeploy/conf/nDeploy-firewall/roles/firehol_deploy/templates/custom_firehol.conf.j2
# edit file /opt/nDeploy/conf/nDeploy-firewall/roles/firehol_deploy/templates/custom_firehol.conf.j2
# Common config you can do
# Allow incoming port 6556 from IP address
server4 custom checkmk "tcp/6556" default accept src
# Allow all incoming ports from
server4 all accept src
# Allow all outgoing ports to
client4 all accept dst
Once you have edited the template
cd /opt/nDeploy/conf/nDeploy-firewall/
ansible-playbook -i ./hosts firewall.yml --extra-vars "ansible_port=22"
# this will deploy your custom template as firehol.conf
firehol try
# ensure firewall rules are activated without any issues

What version of AUTOM8N am I running

AUTOM8N is delivered as RPM packaged software and the version details can be obtained from commandline

All software in AUTOM8N software repository has the tag - nDeploy

[root@li931-182 ~]# rpm -qa|grep nDeploy
nDeploy-4.6-4.el7.noarch                     # AUTOM8N
nginx-nDeploy-1.15.3-2.el7.x86_64            # Nginx

Upgrading AUTOM8N and Nginx

yum --enablerepo=ndeploy upgrade *nDeploy*

# Ensure Nginx has a valid Config
nginx -t

# Restart nginx if Required
needs-restarting |grep nginx && service nginx restart

AUTOM8N cluster upgrade

Upgrade the master and slave individually

yum --enablerepo=ndeploy upgrade *nDeploy*

#Do the following in master Only

cd /opt/nDeploy/conf/nDeploy-cluster
ansible-playbook -i ./hosts cluster.yml

Migrating AUTOM8N settings

In case you are migrating the entire cPanel accounts to a new server.

  1. Do the cPanel migration
  2. Install AUTOM8N on the new server
  3. Edit the file /opt/nDeploy/scripts/ and change REMOTE_SERVER=’ip.ip.ip.ip’ and SSH_PORT with the new servers ip and ssh port
  4. Run the script /opt/nDeploy/scripts/ #Input password of remote server whenever prompted

Temporarily disable the plugin

/opt/nDeploy/scripts/ disable

Uninstall the plugin

/opt/nDeploy/scripts/ disable
yum remove nginx-nDeploy nDeploy

Remove Obsolete PHP-FPM selector plugin

/opt/nDeploy/scripts/ httpd-php-uninstall
/usr/local/cpanel/scripts/uninstall_plugin /opt/nDeploy/PHPfpmSelector