Monthly Archives: October 2020

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: 208.74.123.61
  • cpanel-addons-production-feed: 208.74.123.61
  • cpanel-plugins: 208.74.123.61
  • base: mirrors.radwebhosting.com
  • epel: pubmirror2.math.uh.edu
  • extras: centos.mirror.lstn.net
  • updates: repos.dfw.quadranet.com
    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

Installing:
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

Installed:
brotli.x86_64 0:1.0.7-5.el7

Complete!

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/vnd.ms-fontobject image/x-icon
    </IfModule>

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

[root@server /]# curl -I -H ‘Accept-Encoding: br’ https://tuanpools.com
HTTP/1.1 200 OK
Date: Wed, 28 Oct 2020 14:31:36 GMT
Server: Apache
Link: https://tuanpools.com/wp-json/; rel=”https://api.w.org/”
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

/etc/logrotate.d/libcare

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

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: 208.74.123.61
  • cpanel-addons-production-feed: 208.74.123.61
  • cpanel-plugins: 208.74.123.61
  • base: mirror.oss.ou.edu
  • extras: mirror.oss.ou.edu
  • updates: mirror.netdepot.com
    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

Reinstalling:
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

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

Complete!