Monit usage with files and directories

Cf this documentation: monit

Detect file change

Create configuration file:

nano /etc/monit/conf-available/openlitespeed

And enter this kind of rule:

check file lsws_htaccess with path /usr/local/lsws/vhosts/xxx/http/current/public/.htaccess
   if changed timestamp then exec "/bin/systemctl reload lsws"

Enable this conf:

ln -s /etc/monit/conf-available/openlitespeed /etc/monit/conf-enabled/

Restart monit:

sudo systemctl restart monit