Cachet install on Ubuntu 18.04

Had an opportunity an Operation Notification open source application callled Cachet

Below are the steps I used to successfully complete it and get it working

SSH to Ubuntu server

Set up right time on server using

root@status:~# sudo dpkg-reconfigure tzdata

Current default time zone: ‘America/Chicago’
Local time is now:      Mon Feb 22 10:48:44 CST 2021.
Universal Time is now:  Mon Feb 22 16:48:44 UTC 2021.

Next update the existing system using

root@status:~# sudo apt update && sudo apt upgrade -y

Next install the PHP7 and mariadb using below command

root@status:~# sudo apt install -y php php-cli php-fpm php-common php-xml php-gd php-zip php-mbstring php-mysql php-pgsql php-sqlite3 php-apcu

Next start mysql in secure mode

root@status:~# sudo mysql_secure_installation


In order to log into MariaDB to secure it, we’ll need the current
password for the root user.  If you’ve just installed MariaDB, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

You already have a root password set, so you can safely answer ‘n’.

Change the root password? [Y/n] n
 … skipping.

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 … Success!

Normally, root should only be allowed to connect from ‘localhost’.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 … Success!

By default, MariaDB comes with a database named ‘test’ that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 – Dropping test database…
 … Success!
 – Removing privileges on test database…
 … Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 … Success!

Cleaning up…

All done!  If you’ve completed all of the above steps, your MariaDB
installation should now be secure.

Next Create database and user and assign database to user

root@status:~# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 47
Server version: 10.1.47-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]> CREATE DATABASE nocdb;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> GRANT ALL ON nocdb.* to nocusr@localhost identified by “your-password”;
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> quit

Now install Nginx on server using below command

root@status:~# sudo apt install -y nginx

Now install git and curl on server using

root@status:~# sudo apt install curl git

Now install composer using

root@status:~# curl -sS | sudo php — –install-dir=/usr/local/bin –filename=composer

Now create folder cachet using

root@status:~# sudo mkdir -p /var/www/cachet

root@status:~# sudo chown -R user.user /var/www/cachet
root@status:~# cd /var/www/cachet

root@status:/var/www/cachet# git clone -b 2.4 –single-branch .

root@status:/var/www/cachet# mv .env.example .env

root@status:/var/www/cachet# composer install –no-dev -o

root@status:/var/www/cachet# php artisan cachet:install

 Do you want to configure Cachet before installing? (yes/no) [no]:
 > yes

Environment file already exists. Moving on.
*     Application In Production!     *

 Do you really wish to run this command? (yes/no) [no]:
 > yes

Application key set successfully.

 Which database driver do you want to use?:
  [mysql ] MySQL
  [pgsql ] PostgreSQL
  [sqlite] SQLite
 > mysql

 What is the host of your mysql database?:
 > localhost

Using ‘localhost’ will result in the usage of a local unix socket. Use if you want to connect over TCP

 What is the name of the database that Cachet should use?:
 > nocdb

 What username should we connect with?:
 > nocusr

 What password should we connect with?:

 Is your database listening on a non-standard port number? (yes/no) [no]:
 > no

 Do you want to use a prefix on the table names? (yes/no) [no]:
 > no

| Setting     | Value          |
| DB_DRIVER   | mysql          |
| DB_HOST     | localhost      |
| DB_DATABASE | nocdb       |
| DB_USERNAME | nocusr      |
| DB_PASSWORD | xx345444$ |
| DB_PORT     | 3306           |
| DB_PREFIX   |                |

 Are these settings correct? (yes/no) [no]:
 > yes

| Setting        | Value |
| CACHE_DRIVER   |       |
| SESSION_DRIVER |       |
| QUEUE_DRIVER   |       |

 Which cache driver do you want to use?:
  [apc      ] APC(u)
  [array    ] Array
  [database ] Database
  [file     ] File
  [memcached] Memcached
  [redis    ] Redis
 > apc

 Which session driver do you want to use?:
  [apc      ] APC(u)
  [array    ] Array
  [database ] Database
  [file     ] File
  [memcached] Memcached
  [redis    ] Redis
 > apc

 Which queue driver do you want to use?:
  [null      ] None
  [sync      ] Synchronous
  [database  ] Database
  [beanstalkd] Beanstalk
  [sqs       ] Amazon SQS
  [redis     ] Redis
 > database

| Setting        | Value    |
| CACHE_DRIVER   | apc      |
| SESSION_DRIVER | apc      |
| QUEUE_DRIVER   | database |

 Are these settings correct? (yes/no) [no]:
 > yes

 Do you want Cachet to send mail notifications? (yes/no) [no]:
 > no

 Do you wish to use Cachet Beacon? (yes/no) [no]:
 > no

 Do you wish to use Emoji? This requires a GitHub oAuth Token! (yes/no) [no]:
 > no

 Do you want to create an admin user? (yes/no) [no]:
 > yes

 Please enter your username:
 > your name

 Please enter your email:
 > your email address

Application key set successfully.
Configuration cache cleared!
Configuration cached successfully!
Route cache cleared!
Routes cached successfully!
Copied Directory [/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views] To [/resources/views/errors]
Copied Directory [/vendor/laravel/framework/src/Illuminate/Notifications/resources/views] To [/resources/views/vendor/notifications]
Copied Directory [/vendor/laravel/framework/src/Illuminate/Pagination/resources/views] To [/resources/views/vendor/pagination]
Copied Directory [/vendor/laravel/framework/src/Illuminate/Mail/resources/views] To [/resources/views/vendor/mail]
Publishing complete.
Migration table created successfully.
Migrating: 2015_01_05_201324_CreateComponentGroupsTable
Migrated:  2015_01_05_201324_CreateComponentGroupsTable
Migrating: 2015_01_05_201444_CreateComponentsTable
Migrated:  2015_01_05_201444_CreateComponentsTable
Migrating: 2015_01_05_202446_CreateIncidentTemplatesTable
Migrated:  2015_01_05_202446_CreateIncidentTemplatesTable
Migrating: 2015_01_05_202609_CreateIncidentsTable
Migrated:  2015_01_05_202609_CreateIncidentsTable
Migrating: 2015_01_05_202730_CreateMetricPointsTable
Migrated:  2015_01_05_202730_CreateMetricPointsTable
Migrating: 2015_01_05_202826_CreateMetricsTable
Migrated:  2015_01_05_202826_CreateMetricsTable
Migrating: 2015_01_05_203014_CreateSettingsTable
Migrated:  2015_01_05_203014_CreateSettingsTable
Migrating: 2015_01_05_203235_CreateSubscribersTable
Migrated:  2015_01_05_203235_CreateSubscribersTable
Migrating: 2015_01_05_203341_CreateUsersTable
Migrated:  2015_01_05_203341_CreateUsersTable
Migrating: 2015_01_09_083419_AlterTableUsersAdd2FA
Migrated:  2015_01_09_083419_AlterTableUsersAdd2FA
Migrating: 2015_01_16_083825_CreateTagsTable
Migrated:  2015_01_16_083825_CreateTagsTable
Migrating: 2015_01_16_084030_CreateComponentTagTable
Migrated:  2015_01_16_084030_CreateComponentTagTable
Migrating: 2015_02_28_214642_UpdateIncidentsAddScheduledAt
Migrated:  2015_02_28_214642_UpdateIncidentsAddScheduledAt
Migrating: 2015_05_19_214534_AlterTableComponentGroupsAddOrder
Migrated:  2015_05_19_214534_AlterTableComponentGroupsAddOrder
Migrating: 2015_05_20_073041_AlterTableIncidentsAddVisibileColumn
Migrated:  2015_05_20_073041_AlterTableIncidentsAddVisibileColumn
Migrating: 2015_05_24_210939_create_jobs_table
Migrated:  2015_05_24_210939_create_jobs_table
Migrating: 2015_05_24_210948_create_failed_jobs_table
Migrated:  2015_05_24_210948_create_failed_jobs_table
Migrating: 2015_06_10_122216_AlterTableComponentsDropUserIdColumn
Migrated:  2015_06_10_122216_AlterTableComponentsDropUserIdColumn
Migrating: 2015_06_10_122229_AlterTableIncidentsDropUserIdColumn
Migrated:  2015_06_10_122229_AlterTableIncidentsDropUserIdColumn
Migrating: 2015_08_02_120436_AlterTableSubscribersRemoveDeletedAt
Migrated:  2015_08_02_120436_AlterTableSubscribersRemoveDeletedAt
Migrating: 2015_08_13_214123_AlterTableMetricsAddDecimalPlacesColumn
Migrated:  2015_08_13_214123_AlterTableMetricsAddDecimalPlacesColumn
Migrating: 2015_10_31_211944_CreateInvitesTable
Migrated:  2015_10_31_211944_CreateInvitesTable
Migrating: 2015_11_03_211049_AlterTableComponentsAddEnabledColumn
Migrated:  2015_11_03_211049_AlterTableComponentsAddEnabledColumn
Migrating: 2015_12_26_162258_AlterTableMetricsAddDefaultViewColumn
Migrated:  2015_12_26_162258_AlterTableMetricsAddDefaultViewColumn
Migrating: 2016_01_09_141852_CreateSubscriptionsTable
Migrated:  2016_01_09_141852_CreateSubscriptionsTable
Migrating: 2016_01_29_154937_AlterTableComponentGroupsAddCollapsedColumn
Migrated:  2016_01_29_154937_AlterTableComponentGroupsAddCollapsedColumn
Migrating: 2016_02_18_085210_AlterTableMetricPointsChangeValueColumn
Migrated:  2016_02_18_085210_AlterTableMetricPointsChangeValueColumn
Migrating: 2016_03_01_174858_AlterTableMetricPointsAddCounterColumn
Migrated:  2016_03_01_174858_AlterTableMetricPointsAddCounterColumn
Migrating: 2016_03_08_125729_CreateIncidentUpdatesTable
Migrated:  2016_03_08_125729_CreateIncidentUpdatesTable
Migrating: 2016_03_10_144613_AlterTableComponentGroupsMakeColumnInteger
Migrated:  2016_03_10_144613_AlterTableComponentGroupsMakeColumnInteger
Migrating: 2016_04_05_142933_create_sessions_table
Migrated:  2016_04_05_142933_create_sessions_table
Migrating: 2016_04_29_061916_AlterTableSubscribersAddGlobalColumn
Migrated:  2016_04_29_061916_AlterTableSubscribersAddGlobalColumn
Migrating: 2016_06_02_075012_AlterTableMetricsAddOrderColumn
Migrated:  2016_06_02_075012_AlterTableMetricsAddOrderColumn
Migrating: 2016_06_05_091615_create_cache_table
Migrated:  2016_06_05_091615_create_cache_table
Migrating: 2016_07_25_052444_AlterTableComponentGroupsAddVisibleColumn
Migrated:  2016_07_25_052444_AlterTableComponentGroupsAddVisibleColumn
Migrating: 2016_08_23_114610_AlterTableUsersAddWelcomedColumn
Migrated:  2016_08_23_114610_AlterTableUsersAddWelcomedColumn
Migrating: 2016_09_04_100000_AlterTableIncidentsAddStickiedColumn
Migrated:  2016_09_04_100000_AlterTableIncidentsAddStickiedColumn
Migrating: 2016_10_24_183415_AlterTableIncidentsAddOccurredAtColumn
Migrated:  2016_10_24_183415_AlterTableIncidentsAddOccurredAtColumn
Migrating: 2016_10_30_174400_CreateSchedulesTable
Migrated:  2016_10_30_174400_CreateSchedulesTable
Migrating: 2016_10_30_174410_CreateScheduleComponentsTable
Migrated:  2016_10_30_174410_CreateScheduleComponentsTable
Migrating: 2016_10_30_182324_AlterTableIncidentsRemoveScheduledColumns
Migrated:  2016_10_30_182324_AlterTableIncidentsRemoveScheduledColumns
Migrating: 2016_12_04_163502_AlterTableMetricsAddVisibleColumn
Migrated:  2016_12_04_163502_AlterTableMetricsAddVisibleColumn
Migrating: 2016_12_05_185045_AlterTableComponentsAddMetaColumn
Migrated:  2016_12_05_185045_AlterTableComponentsAddMetaColumn
Migrating: 2016_12_29_124643_AlterTableSubscribersAddPhoneNumberSlackColumns
Migrated:  2016_12_29_124643_AlterTableSubscribersAddPhoneNumberSlackColumns
Migrating: 2016_12_29_155956_AlterTableComponentsMakeLinkNullable
Migrated:  2016_12_29_155956_AlterTableComponentsMakeLinkNullable
Migrating: 2017_01_03_143916_create_notifications_table
Migrated:  2017_01_03_143916_create_notifications_table
Migrating: 2017_02_03_222218_CreateActionsTable
Migrated:  2017_02_03_222218_CreateActionsTable
Migrating: 2017_06_13_181049_CreateMetaTable
Migrated:  2017_06_13_181049_CreateMetaTable
Migrating: 2017_07_18_214718_CreateIncidentComponents
Migrated:  2017_07_18_214718_CreateIncidentComponents
Migrating: 2017_09_14_180434_AlterIncidentsAddUserId
Migrated:  2017_09_14_180434_AlterIncidentsAddUserId
Migrating: 2018_04_02_163328_CreateTaggablesTable
Migrated:  2018_04_02_163328_CreateTaggablesTable
Migrating: 2018_04_02_163658_MigrateComponentTagTable
Migrated:  2018_04_02_163658_MigrateComponentTagTable
Migrating: 2018_06_14_201440_AlterSchedulesSoftDeletes
Migrated:  2018_06_14_201440_AlterSchedulesSoftDeletes
Migrating: 2018_06_17_182507_AlterIncidentsAddNotifications
Migrated:  2018_06_17_182507_AlterIncidentsAddNotifications
Migrating: 2019_12_12_131400_AlterJobsDropReserved
Migrated:  2019_12_12_131400_AlterJobsDropReserved
Database seeding completed successfully.
Clearing cache…
Application cache cleared!
Cache cleared!
The [public/storage] directory has been linked.
Cachet is installed ⚡

The viifbr0 is not started. Please run service virtnetwork start

We were facing this issue on newly installed Centos 7 with Virtualizor on KVM

Where The viifbr0 is not started. Please run service virtnetwork start

error was showing up.

We went ahead and changed interface settings to enp5s0f0 based on our interface settings

However the issue still was persisting.

[root@PS1122 ~]# service virtnetwork start
SIOCADDRT: Network is unreachable
Bringing up viifbr0 – OK
Waiting for 10 seconds…1…2…3…4…5…6…7…8…9…10
Checking network connectivity through ping to
connect: Network is unreachable
Internet connectivity check failed … Restarting normal network
Stopping viifbr0 … Restarting normal network
Restarting network (via systemctl):                        [  OK  ]

So what we did was checked our file vi /etc/sysconfig/network-scripts/ifcfg-enp5s0f0

The netmask had value of /21

We changed it to and restarted network

This resolved our issue and virtualizor issue was resolved

[root@PS1122 ~]# service virtnetwork start
Bringing up viifbr0 – OK
Waiting for 10 seconds…1…2…3…4…5…6…7…8…9…10
Internet connectivity check successful viifbr0 – OK
[root@OK1122 ~]#

Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

While trying to add new user and ssh using the user login details after adding user ssh keys

was getting below error

Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

The issue was due to permissions

Changing to below permissions resolved the issue

chmod 0700 /home/surmeet/.ssh/

chmod 0600 /home/surmeet/.ssh/authorized_keys

MySQL: Stale lock file prevents the service from starting

Attempting to start the MySQL service results in the following error:

[ERROR] Unix socket lock file is empty /var/lib/mysql/mysql.sock.lock. 
[ERROR] Unable to setup unix socket lock file.

Below were the errors in mysql error log

2021-01-06T01:29:39.630848Z 0 [Note] – ‘’ resolves to ‘’;
2021-01-06T01:29:39.630871Z 0 [Note] Server socket created on IP: ‘’.
2021-01-06T01:29:39.630932Z 0 [ERROR] Unix socket lock file is empty /var/lib/mysql/mysql.sock.lock.
2021-01-06T01:29:39.630943Z 0 [ERROR] Unable to setup unix socket lock file.
2021-01-06T01:29:39.630952Z 0 [ERROR] Aborting


A stale lock file is preventing the MySQL service from starting up. The ‘stat’ command can be used to compare the age of the lock file to the current time, in order to confirm that the lock file is stale:

# stat /var/lib/mysql/mysql.sock.lock

The above command should confirm the presence of an old lock file that is empty.


It can be difficult to determine why a stale lock file was left behind, however, moving the stale lock file aside should allow MySQL to start up normally. The following commands will need to be executed as the root user via WHM’s Terminal application, or via shell:

# mkdir -v /root/stale_mysql_lock_files
# mv -v /var/lib/mysql/mysql.sock.lock /root/stale_mysql_lock_files
# /usr/local/cpanel/scripts/restartsrv_mysql

adminbin Cpanel/cpmysql/DBCACHE: exit 11

Currently aware of an issue when updating to MariaDB 10.3.26 or MariaDB 10.2.35. Which causes MySQL Databases interface within cPanel to display invalid errors such as, but not limited to: “The MySQL server is currently offline”.

While the error in cPanel may indicate that the MySQL service is offline, it is an issue with grants and MySQL is just inaccessible for the cPanel user. We do recommend checking the service directly to confirm that it is online – in the cases, we have seen MySQL is still online.

You may temporarily resolve the issue by downgrading to the previous minor version of MariaDB using the steps outlined

Follow below steps

yum downgrade MariaDB-server MariaDB-common MariaDB-shared MariaDB-client MariaDB-compat MariaDB-devel

If your server has not yet been affected by the issue, we recommend yum-locking the MariaDB packages in place to avoid the package from being updated. This can be completed by executing the following:

yum install -y yum-plugin-versionlock && yum versionlock MariaDB-* 

And restart mysql to resolve the issue

Install Brotli on Apache 2.4 on cPanel

[root@server /]# yum install brotli
Loaded plugins: fastestmirror, getpagespeed, universal-hooks
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 8.6 kB 00:00:00

  • EA4:
  • cpanel-addons-production-feed:
  • cpanel-plugins:
  • base:
  • epel:
  • extras:
  • updates:
    Resolving Dependencies
    –> Running transaction check
    —> Package brotli.x86_64 0:1.0.7-5.el7 will be installed
    –> Finished Dependency Resolution

Dependencies Resolved


Package Arch Version Repository Size

brotli x86_64 1.0.7-5.el7 epel 318 k

Transaction Summary

Install 1 Package

Total download size: 318 k
Installed size: 1.5 M
Is this ok [y/d/N]: y
Downloading packages:
brotli-1.0.7-5.el7.x86_64.rpm | 318 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : brotli-1.0.7-5.el7.x86_64 1/1
Verifying : brotli-1.0.7-5.el7.x86_64 1/1

brotli.x86_64 0:1.0.7-5.el7


Now go to Home »Service Configuration »Apache Configuration >> Include Editor >> Pre main include

Add below entries and save a

<IfModule mod_brotli.c>
    AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript application/x-javascript application/javascript application/json application/x-font-ttf application/ image/x-icon

Check using below command to find encoding. It should show br

[root@server /]# curl -I -H ‘Accept-Encoding: br’
HTTP/1.1 200 OK
Date: Wed, 28 Oct 2020 14:31:36 GMT
Server: Apache
Link:; rel=””
Vary: Accept-Encoding
Content-Encoding: br
Content-Length: 1
Content-Type: text/html; charset=UTF-8

[root@server /]#

WHMCS client area blank

I was having an issue where WHMCS admin panel was working fine

However client area was showing blank page

So I enabled error logging in WHMCS in configuration.php file using below paraneter

$display_errors = true;

and tried accessing WHMCS client area
It showed Memory error which was a PHP memory issue 

Increasing PHP memory fixed the issue

error: libcare:3 bad rotation count ‘5

Got an error from Anacron below error

error: libcare:3 bad rotation count ‘5 # keep 5 last archives’
error: found error in /var/log/libcare/*.log , skipping

The fix to this issue was

open file


/var/log/libcare/*.log {
rotate 5 #keep 5 last archives
missingok # it's ok if there is no such file
notifempty # do nothing if file is empty

Remove line "#keep 5 last archives" and save file

This fixes the issue

Cannot open /var/log/sa/sa09: No such file or directory

Have been getting emails on below error

“Cannot open /var/log/sa/sa09: No such file or directory”

The solution is to reinstall cronie-anacron using command

yum reinstall cronie-anacron

Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile

  • EA4:
  • cpanel-addons-production-feed:
  • cpanel-plugins:
  • base:
  • extras:
  • updates:
    EA4 | 2.9 kB 00:00:00
    cpanel-addons-production-feed | 2.9 kB 00:00:00
    cpanel-plugins | 2.9 kB 00:00:00
    MariaDB101 | 2.9 kB 00:00:00
    Resolving Dependencies
    There are unfinished transactions remaining. You might consider running yum-complete-transaction, or “yum-complete-transaction –cleanup-only” and “yum history redo last”, first to finish them. If those don’t work you’ll have to try removing/installing packages by hand (maybe package-cleanup can help).
    –> Running transaction check
    —> Package cronie-anacron.x86_64 0:1.4.11-23.el7 will be reinstalled
    –> Finished Dependency Resolution

Dependencies Resolved


Package Arch Version Repository Size

cronie-anacron x86_64 1.4.11-23.el7 base 36 k

Transaction Summary

Reinstall 1 Package

Total download size: 36 k
Installed size: 41 k
Is this ok [y/d/N]: y
Downloading packages:
cronie-anacron-1.4.11-23.el7.x86_64.rpm | 36 kB 00:00:15
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : cronie-anacron-1.4.11-23.el7.x86_64 1/1
Verifying : cronie-anacron-1.4.11-23.el7.x86_64 1/1

cronie-anacron.x86_64 0:1.4.11-23.el7