Cpanel whmapi1 tool notes

Check bandwidth for a user:

whmapi1 showbw searchtype=user search=USERNAME year 2018 month 8

Change account's master domain:

whmapi1 modifyacct user=USERNAME domain=NEWDOMAINNAME

Change username:

whmapi1 modifyacct user=USERNAME newuser=NEWUSERNAME

Change package:

whmapi1 changepackage user=USERNAME pkg=NEWPKG

Show account's info:

whmapi1 accountsummary user USERNAME

Enable shell access:

whmapi1 modifyacct user=USERNAME HASSHELL=1
read -p "Username: " u; whmapi1 modifyacct user=$u HASSHELL=1

Update hostname:

whmapi1 sethostname hostname=HOSTNAME

Generate self signed SSL certificate:

whmapi1 generatessl countryName=US stateOrProvinceName=Texas localityName=Houston organizationName="The Justice League" pass=12345luggage keysize=2048 skip_certificate=0

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

Fetch SSL info:

whmapi1 fetchsslinfo

Change account's IP address:

whmapi1 setsiteip ip= user=USERNAME

Show server's IPs

whmapi1 listips

Amount of cPanel's users

whmapi1 listaccts | grep -oP '(?<=user: )\w+$' |wc -l

Disabling/Enabling cPanel services:

to disable:

whmapi1 configureservice service=SERVICE enabled=0 monitored=0

to enable:

whmapi1 configureservice service=SERVICE enabled=1 monitored=1


Mass action disable:

for i in crond exim exim-altport ftpd httpd imap lmtp mailman mysql pop rsyslogd spamd cpanel-dovecot-solr; do whmapi1 configureservice service=$i enabled=0 monitored=0; done

Mass action enable:

for i in crond exim exim-altport ftpd httpd imap lmtp mailman mysql pop rsyslogd spamd; do whmapi1 configureservice service=$i enabled=1 monitored=1; done

Enable individual services

whmapi1 configureservice service=lfd enabled=1 monitored=1
whmapi1 configureservice service=sshd enabled=1 monitored=1
whmapi1 configureservice service=rsyslogd enabled=1 monitored=1
whmapi1 configureservice service=cpdavd enabled=1 monitored=1

To get feature list:

whmapi1 get_feature_names

To disable a feature (all right its 1):

whmapi1 update_featurelist featurelist=disabled caldavcarddav=1

To get user's ftp account list:

cpapi2 --user=USERNAME Ftp listftp

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *