Important cPanel Scripts

Hello,

We used to do a lot of things so easily just by clicking on the buttons and links in WHM everyday. Let us see how same can be done from Command line using Cpanel Scripts.

1) Add a Wheel user
/scripts/adduser wheel1 /home wheel@123

2) Add a mysql user
/scripts/mysqladduserdb mysqluser password

3) Whitelist an IP in Cphulkd
/scripts/cphulkdwhitelist IP-address

4) To blacklist an IP in cphulkd
/scripts/cphulkdblacklist IP-address

5) To terminate a cpanel account :
/scripts/killacct username

This one will soon be changed to removeacct in furute versions of Cpanel.

6) To suspend an account:
/scripts/suspendacct username

7) To unsuspend an account:
/scripts/unsuspendacct username

8) To edit the cpanel user quota:
/scripts/editquota username 512M
/scripts/editquota username 5000M

9) To find hacks
/scripts/findhacks

10) Now service management
/scripts/restartsrv_*
The * symbol can be replaced by any of the following service names:
~~~
apache               Restarts the Apache web server.
bind                     Restarts the BIND nameserver software.
chkservd           Restarts cPanel’s TailWatch log processing service.
clamd                  Restarts the ClamAV antivirus software.
courier               Restarts the Courier mail server.
cpdavd               Restarts cPanel’s WebDAV server.
cphulkd              Restarts cPHulk.
cpsrvd                Restarts the cpsrvd daemon.
crond                  Restarts the crond daemon.
dovecot             Restarts the Dovecot mail server.
exim                    Restarts the Exim mail exchanger.
ftpd                     Restarts the configured FTP service (ProFTPd or Pure-FTPd).
httpd                  Restarts the Apache web server.
imap                   Restarts the IMAP server (Courier or Dovecot).
inetd                   Restarts the super-server daemon that manages Internet services.
ipaliases            Restarts the IP address aliasing software.
mailman            Restarts Mailman.
mydns                Restarts the MyDNS server.
mysql                  Restarts the MySQL database server.
named                Restarts the BIND nameserver software.
postgres            Restarts the PostgreSQL database service.
proftpd              Restarts the ProFTPd server daemon.
pureftpd           Restarts the Pure-FTPd server daemon.
spamd                Restarts the Apache SpamAssassin™ daemon.
sshd                    Restarts the Secure shell daemon.
tailwatchd        Restarts cPanel’s TailWatch log processing service.
tomcat               Restarts the Apache Tomcat service.
~~~

eg: /scripts/restartsrv_dovecot        to restart Dovecot service.

11) Install CPAN/perl modules
/scripts/realperlinstaller

12) Install PHP extensions
/scripts/phpextensionmgr

Usage:
-bash-3.2# /scripts/phpextensionmgr list
Available Extensions:
EAccelerator
IonCubeLoader
Zendopt
Xcache
SourceGuardian
PHPSuHosin
To install an Extension use the exact name in the extension list shown above:
/scripts/phpextensionmgr install Zendopt
To uninstall an extension:
/scripts/phpextensionmgr uninstall Zendopt

13) To install Ruby
/scripts/installruby

14) To install PostGreSQL
/scripts/installpostgres

15) Install GD
/scripts/installgd

16) Install Imagemagick
/scripts/installimagemagick

17) Install IPC Cache
/scripts/installipc

18) Install Zend Optimizer
/scripts/installzendopt

19) Install SQLite
/scripts/installsqlite3

20) Switching between Courier and dovecot mail servers
/scripts/convert2courier – To switch to Courier IMAP server.
/scripts/convert2dovecot – To Switch to Dovecot IMAP server.

21) Your Webalizer stoped updating?
/scripts/fixwebalizer

22) To genearte the CSR and Certificate file:
/scripts/gencrt

23) Check IP address Usage:
/scripts/ipusage

24) Disable SpamAssassin server wide:
/scripts/spamassassindisable

25) Change MySQL password for a mySQL user:
/scripts/mysqlpasswd

I hope you find this post useful. Thank you. Have a great day 🙂 🙂

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s