How to change master domain on cPanel server from command line
Run the following to change your master domain:
whmapi1 modifyacct user=USERNAME domain=NEWDOMAIN.COM
Enjoy!
… Read the restNotes
Run the following to change your master domain:
whmapi1 modifyacct user=USERNAME domain=NEWDOMAIN.COM
Enjoy!
… Read the restRun and put your domain:
read -p "Domain: " domain; username=`/scripts/whoowns $domain`; email=`grep @ /var/cpanel/users/$username |tail -n1 |cut -d '=' -f2|sed -e 's/@/\%40/'`; whmapi1 generatessl domains=$domain countryName=US stateOrProvinceName=Texas localityName=Houston organizationName="The Justice League of GG" emailAddress=$email pass=`openssl rand -base64 15` keysize=2048 skip_certificate=0
Now use WHM to install it
Enjoy!… Read the rest
To see your swap usage run the following:
free -m
To disable swap without reboot and just temporary run the following:
sudo swapoff -a
This will wipe out used swap space and disable it
To get this enabled again run next:
sudo swapon -a
To disable swap permanently you need to edit /etc/fstab as root and comment out a line related to swap
For example:
cat /etc/fstab |grep swap
# swap was on /dev/nvme0n1p6 during installation
#UUID=d10c1d70-bb88-43fc-bbe2-e17592b660ba none swap sw 0 0
Then reboot your machine to apply the change or try to run next:
mount -a
To reboot run:
reboot
Enjoy!… Read the rest
Run to the following command to start calculation:
SELECT CEILING(Total_InnoDB_Bytes*1.6/POWER(1024,3)) RIBPS FROM (SELECT SUM(data_length+index_length) Total_InnoDB_Bytes FROM information_schema.tables WHERE engine='InnoDB') A;
Example:
… Read the restmysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 60295069
Server version: 10.3.34-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
You need to update /etc/my.cnf with the following:
log_warnings = 1
And restart mysql server
service mysql restart
Source: https://dba.stackexchange.com/questions/282968/mariadb-aborted-connection-got-timeout-reading-communication-packets… Read the rest
Useful if you have plan limited by:
– limitation by amount of cPanel accounts
– bandwidth limitation
– disk space limitation
– overselling disabled
Update reseller’s packages with new limits via command line
sed -i -e "s/QUOTA=.*/QUOTA=2000/g" /var/cpanel/packages/resellerusername_* sed -i -e "s/BWLIMIT=.*/BWLIMIT=20000/g"… Read the rest
Useful when you try to send a request from cPanel shell from your Dedicated IP address
For curl you need to use –interface to specify IP address
Example:
curl --interface 11.22.33.44 http://alltime.pp.ua/
For wget you need to use –bind-address to set IP from which you need to send a request
wget --bind-address=192.0.2.116 http://alltime.pp.ua/… Read the rest
This may occur because of UTF8 formatting was not enabled
– Navigate to cPanel –> Email –> Email Accounts.
– Select Manage next to the “Default” account.
– Enable the toggle under “UTF-8 Mailbox Names”.
You may also inspect Roundcube interface setting for UTF8 formatting enabling… Read the rest
Find rmlist binary file under /usr/local/cpanel/3rdparty/mailman/bin folder
For more info run:
root@chi101 [/usr/local/cpanel/3rdparty/mailman/bin]# ./rmlist --help
… Read the restUsage:
rmlist [-a] [-h] listnameWhere:
–archives
-a
Remove the list’s archives too, or if the list has already been
deleted, remove any residual archives.–help
-h
Print this help message and exit.