Restore VM on OpenVZ Node

Using wget

On VPS node run:

cd /vz

Then enter location to where the backup file is installed e.g

wget http://xxx.xx.xxx.xx/~example1/200-vz-250-1.tgz

Then restore the VM by running the following command from the VPS node e.g

vzdump --restore /vz/200-vz-250-1.tgz 250

Then in SoluSVM go to Dashboard – Configuration – General Settings – Other – Import Mode = On

Then go to Virtual Servers – Add Virtual Server – Select Virtualization Type = OpenVZ and enter information. Once completed set Import Mode back to “Off”.

Free up diskspace on a cPanel server

################################################
Summary of all used commands, for clearing /home
################################################

find /home/ -name error_log -type f -print -exec truncate --size 0 "{}" \;
rm -rfv /home/cpeasyapache
rm -fv /home*/*/.softaculous/backups/*
for user in `/bin/ls -A /var/cpanel/users` ; do rm -fv /home/$user/backup-*$user.tar.gz ; done
rm -rfv /home/*/fantastico_backups
rm -fv /home/*/tmp/Cpanel_*
rm -rvf /home/cpmove-*
rm -rvf /home*/cpanelpkgrestore.TMP*

###############################################
Summary of all used commands, for clearing /usr
###############################################

rm -rfv /usr/local/apache.backup*
rm -rfv /usr/local/maldet.bk*
rm -fv /usr/local/maldetect/logs/*
rm -fv /usr/local/cpanel/logs/archive/*.gz
rm -fv /usr/local/apache/logs/*.gz
rm -fv /usr/local/apache/logs/archive/*.gz

#################
Reduce /var usage
#################

rm -fv /var/log/*.gz
rm -fv /var/log/*201*

################
Find large files
################

cd /path e.g cd /var/lib/mysql
du --max-depth=1 | sort -n | awk 'BEGIN {OFMT = "%.0f"} {print $1/1024,"MB", $2}'

################
Yum clean all
################

Simply run yum clean all

Whitelist HetrixTools in CSF

Download the latest IPs

wget -O hetrixtools.txt https://hetrixtools.com/resources/uptime-monitor-ips.txt

Display the latest IPs

awk '{print "csf -a",$2, $1}' hetrixtools.txt | sort -r

which will return something like

csf -a 78.46.88.58 wk5-1.hetrixtools.com
csf -a 52.67.204.189 wk9.hetrixtools.com
csf -a 52.65.182.14 wk8.hetrixtools.com
csf -a 52.59.92.96 wk5.hetrixtools.com
csf -a 52.56.73.124 wk4.hetrixtools.com
csf -a 52.52.33.209 wk2-1.hetrixtools.com
csf -a 52.23.120.125 wk1-2.hetrixtools.com
csf -a 52.221.91.160 wk6.hetrixtools.com
csf -a 52.207.73.67 wk1-1.hetrixtools.com
csf -a 52.207.41.187 wk1.hetrixtools.com
csf -a 52.199.17.123 wk10.hetrixtools.com
csf -a 51.15.61.222 wk3-1.hetrixtools.com
csf -a 40.113.121.72 wk3.hetrixtools.com
csf -a 35.154.5.38 wk11.hetrixtools.com
csf -a 185.143.173.230 wk12.hetrixtools.com
csf -a 13.93.49.243 wk3-2.hetrixtools.com
csf -a 139.162.228.62 wk4-1.hetrixtools.com
csf -a 139.162.22.205 wk6-1.hetrixtools.com
csf -a 139.162.179.99 wk5-2.hetrixtools.com
csf -a 104.40.93.217 wk2.hetrixtools.com
csf -a 104.237.139.48 wk7.hetrixtools.com

You can then run the commands in SSH to add the monitoring IPs to CSF whitelist.

Install Imunify360

wget http://repo.imunify360.cloudlinux.com/defence360/i360deploy.sh
bash i360deploy.sh --key

yum update imunify360-firewall --enablerepo=imunify360-testing

Use both Comodo and Imunify360 rules

Set LF_MODSEC variable to “0” in CSF config.

If you have trouble with Imunify360 and would just like to temporarily disable it:

systemctl stop imunify360
systemctl stop imunify360-captcha
systemctl disable imunify360

If you Imunify360 services are stopped and you would like to have them running again:

systemctl start imunify360
systemctl start imunify360-captcha
systemctl enable imunify360

If you would like support from CloudLinux (developers of Imunufy360), add the following SSH key to your server, as well as whitelist their IPs in your firewall

ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEA0kzTrtnpG3awsKlQRzo8tLzG0Rb93XO6plRtFsVmAtqyuk1nfwC36ISL+AT2+r4+xuZiK8taVgbPVDU/+dHD3ObMQPIvIZOvQWGZH0zZApeXfbKD3DaLfh5aQeI9kbeo3cGQufFIxTkSLVXHTmjISf3gggP7m17hI4jxiu5Gaw/lNwlrQtsBgyEsF4+Y5jSOn1fMkx+R//8ul6L97EBEIGA9Pzcy4tHtTCNxfAGOmUmx8ijnieqNb95wxU5hrhirmWbICeMkgECEsIOPkweWoBNmrVxAigSQuM0uJZeFl5x2I5KaocmXbpeswDCWjGCtEDjcY9WqBSGehuUxArZvGEcaeJ+AM+xIlr0yPTx+3y4JsN/hluzRX9vbuzBZxhctP0BALu8uXKjYvJr9STU0umNZrRHBBQKCIF16FPwcJ7d+H4KYFvxOiVTDKtIZJ5gCtp/nUtVeQFUPEwgirgypP4hv3gkE73A+2vl3lwZ1p2YBmzzbAOpeXDtDFNSpK6Kfa7ujK70ouM0EDptPe/aGJMuDet7RGlnn/zQdpXrCLpUZSVrsTFjN+NZ6uTah5r5QsOhTpL1IoD+FrW9ovgr6KwtM6rl/XKzrzmbnQGaGQY5h5Kan2a0Y24eIXm5MnncOgwZZUCpT7SV2b7cjASf5xMfU87Ihe3c/Vmi33pblD8E= [email protected]

69.175.106.198 # CloudLinux
69.175.3.6 # CloudLinux

Install Engintron

Install

cd /; rm -f engintron.sh; wget --no-check-certificate https://raw.githubusercontent.com/engintron/engintron/master/engintron.sh; bash engintron.sh install

# === FOR USE WITH CLOUDFLARE ===
#
#
a) If your server has a single shared IP ONLY and you wish to use CloudFlare for any (or all) of your sites
# you will have to specify this shared IP address below otherwise you'll get errors from CloudFlare.
# This change will simply tell Nginx to skip DNS resolving and simply forward traffic to the shared IP.
# Uncomment the following line if all your sites on the shared (main) IP of your server are on CloudFlare:
#
set $PROXY_DOMAIN_OR_IP "xx.xx.xxx.xxx"; # Use your cPanel's shared IP address here

Uninstall

bash /engintron.sh remove