How to work around “is not an EA4 SCL PHP” error

“ea-php72” is not an EA4 SCL PHP

Update both .bash_profile and .bashrc files under your home/ directory as following:

export PATH=/opt/alt/php72/usr/bin:$PATH
alias ea-php72="/usr/local/bin/lsphp"

Use a real path to your PHP binary file if its not yours /usr/local/bin/lsphp

Run to apply updates:

source .bashrc
Read the rest

How to remove mailman archives on cPanel server

Find your mbox files

ls -la /usr/local/cpanel/3rdparty/mailman/archives/private/my1_lists.domain.com.mbox/my1_lists.domain.com.mbox
ls -la /usr/local/cpanel/3rdparty/mailman/archives/private/my2_lists.domain.com.mbox/my2_lists.domain.com.mbox

Backup *.mbox files if needed and empty them:

truncate -s 0 /usr/local/cpanel/3rdparty/mailman/archives/private/my1_lists.domain.com.mbox/my1_lists.domain.com.mbox
truncate -s 0 /usr/local/cpanel/3rdparty/mailman/archives/private/my2_lists.domain.com.mbox/my2_lists.domain.com.mbox

Go to bin/ folder and wipe as following:

cd /usr/local/cpanel/3rdparty/mailman/bin

./arch --wipe my1_lists.domain.com
./arch --wipe my2_lists.domain.com
Read the rest

How to create a file of specific size using Linux command line

Reduce size using truncate command

Run for a second:

yes "some text" > testfile.txt

Reduce size using truncate:

truncate -s 50M testfile.txt

Create 50M file using fallocate command

fallocate -l 52428800 testfile.txt

To be more exact using inline arithmetic:

fallocate -l $((50*1024*1024)) testfile.txt
Read the rest

Configure CSF on CentOS 7

Install needful packages if you haven’t yet

yum install wget vim perl-libwww-perl.noarch perl-Time-HiRes -y

Download and install CSF

cd /usr/src/
wget https://download.configserver.com/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh

Run test:

cd /usr/local/csf/bin/
perl csftest.pl

Disable default Centos 7 firewall if you have it installed

systemctl stop firewalld
systemctl disable firewalld

Disable testing mode

cd /etc/csf/
vim csf.conf
Read the rest