Backup all cPanel accounts (then restore them) from ssh as root

To backup all accounts at once use the following command: for backup in `\ls /var/cpanel/users/`; do echo /scripts/pkgacct $backup; done   Afterwards download the backup files created (they will begin with cpmove- and be in the /home directory) To restore the backups upload the files under /home on the server then run the following also while within the /home directory: for backup in `ls |grep cpmove- | cut -d- -f2…

Creating a PFX file from a CRT and KEY using OpenSSL

You can easily create a PFX file to install your SSL certificate in IIS from KEY and CRT files using OpenSSL: openssl pkcs12 -export -out -inkey -in   or if you have the root CA and intermediate certificates the command is: openssl pkcs12 -export -out -inkey -in -in intermediate.crt -in rootca.crt

Correct the permissions of /home on a cPanel server

Handy script to correct the permissions of /home on a cPanel server: echo -e “Checking ownership of /home/user \n” for i in `ls /var/cpanel/users/` do if [ “$i” != “root” ]; then chown -R $i:$i /home/$i chown $i:nobody /home/$i/public_html /home/$i/.htpasswds chown $i:mail /home/$i/etc /home/$i/etc/*/shadow /home/$i/etc/*/passwd echo $i fi done Credit goes to

WHM has detected a manual hostname change.

If you received an email that contained the following: The system detected an invalid hostname configuration on: XXXXXXXXX The main IP address of your cPanel & WHM server is “XXX.XXX.XXX.XXX”. The hostname does not resolve to this IP address. This misconfiguration can cause some services on your server to fail to restart properly. The cause of your misconfiguration is: WHM has detected a manual hostname change. First make sure the…

Forcing a Reboot (or Shutdown) with Linux

  • September 10, 2015
  • Linux

If you’ve ever had to reboot (or shutdown) a Linux system but the normal methods (reboot/shutdown/init) were not working (typically due to hanging processes) you can use the sysrq method instead: To reboot: echo 1 > /proc/sys/kernel/sysrq echo b > /proc/sysrq-trigger To shutdown: echo 1 > /proc/sys/kernel/sysrq echo b > /proc/sysrq-trigger

MySQL: Temporary failure in name resolution

If your MySQL server is not responding, and you’re seeing a lot of these in your mysql logs: XXXXX XX:XX:XX [Warning] IP address ‘XXX.XXX.XXX.XXX’ could not be resolved: Temporary failure in name resolution Try adding the following: skip-host-cache skip-name-resolve   to your my.cnf under [mysqld] then restart mysqld. That should address the issue!