CWP scripts

Similar to cPanel, CWP provideseasy-to-use scripts in the /scripts directory. The /scripts directory is a shortcut to /usr/local/cwpsrv/htdocs/resources/scripts

[root@cwp1 ~]# ls -l /scripts
lrwxrwxrwx 1 root root 42 Mar 24 07:06 /scripts -> /usr/local/cwpsrv/htdocs/resources/scripts
[root@cwp1 ~]#

At the time of writing this article, the available scripts are (36 scripts):

  1. add_alert – this is for development purposes. Use it to send messages to the admin dashboard. Use it as:

    /scripts/add_alert alert-type "text message"  example: /scripts/add_alert alert-info "update PHP to 7.2" 

    # Available options: alert-danger, alert-success, alert-info, alert-warning, alert-dismissable
    # Example: “Hello world, this is my test message!”

  2. check_api – it’s a diagnostic tool for CWP support. The output looks like:

    [root@cwp1 ~]# /scripts/check_api User API port 2302 check: OK Oauth query check: OK User API folder check: OK External API port 2304 check: OK External API files and htaccess : OK CSF Firewall status check: ENABLED TCP_IN for port 2304 set in /etc/csf/csf.conf: FAILED TCP_OUT for port 2304 set in /etc/csf/csf.conf: FAILED [root@cwp1 ~]#
  3. check_postqueue – shows how many emails were deferred. Output:

    [root@cwp1 ~]# /scripts/check_postqueue 37 [root@cwp1 ~]#
  4. checkdb – it checks the server for bad tables.

  5. clamd_fix_100_cpu_usagescript will fix clamd 100% cpu usage on the centos 7 servers 

  6. cwp_bruteforce_protection – enables brute-force protection for ports 2030 and 2031

    [root@cwp1 ~]# /scripts/cwp_bruteforce_protection CWP Scripts ################################ Redirecting to /bin/systemctl restart  lfd.service You need to restart Firewall for changes to affect!! csf -r [root@cwp1 ~]# 
  7. cwp_monitor – monitors CWP critical load

  8. cwp_version – shows the CWP server version as:

    [root@cwp1 ~]# /scripts/cwp_version 0.9.8.592 [root@cwp1 ~]# 
  9. cwpsrv_rebuild_user_conf – recreates CWP configuration files and restarts CWP.

  10. disk_check – it check the disk space used by some directories:
    [root@cwp1 ~]# /scripts/disk_check 272M    /var/log/ 216K    /usr/local/apache/logs/ 24M     /usr/local/cwpsrv/logs/ 212M    /tmp 788K    /root 176M    /var/lib/mysql/ [root@cwp1 ~]# 
  11. freshclam – updates ClamAV definitions (not the program itself):
    [root@cwp1 ~]# /scripts/freshclam ClamAV update process started at Tue Apr 10 12:57:43 2018 WARNING: Your ClamAV installation is OUTDATED! WARNING: Local version: 0.99.4 Recommended version: 0.100.0 DON'T PANIC! Read http://www.clamav.net/documents/upgrading-clamav main.cvd is up to date (version: 58, sigs: 4566249, f-level: 60, builder: sigmgr) daily.cld is up to date (version: 24467, sigs: 1905395, f-level: 63, builder: neo) bytecode.cvd is up to date (version: 319, sigs: 75, f-level: 63, builder: neo) [root@cwp1 ~]# 
  12. generate_hostname_ssl – generates a self-signed certificate for the hostname. We don’t recommend using this script. Check our article on how to Set up an SSL certificate for hostname on CentOS Web Panel

  13. install_api – installs CWP API configuration

  14. install_imagick – installs Imagick

  15. install_maldet – installs Maldet

  16. install_net2ftp – installs net2ftp (a web-based FTP client)

  17. install_supportKey – installs the CWP SSH Support key

  18. list_domains – lists all the domains on the server:

    [root@cwp1 ~]# /scripts/list_domains DOMAIN | USER | PATH ################################# newdomain.com   demo    /home/demo/public_html/newdomain.com [root@cwp1 ~]# 
  19. list_subdomains – lists all subdomains

  20. list_users – lists all users:

    [root@cwp1 ~]# /scripts/list_users USERNAME | DOMAIN | IP ADDRESS | EMAIL | PACKAGE ID | BACKUP ############################################################### cwp1    cwp1.plothost.com       104.237.208.145 my@email.com    1       on plothost        plothost1.com   104.237.208.145 admin@plothost.com      1       on demo    demo.plothost.com       104.237.208.145 admin@plothost.com      1       on [root@cwp1 ~]# 
  21. mail_queue_stats –  shows mail stats:
    [root@cwp1 ~]# /scripts/mail_queue_stats maildrop 0 incoming 0 hold 0 active 0 deferred 36 [root@cwp1 ~]# 
  22. mysql_fix_myisam_tables – fix MyISAM tables

  23. mysql_pwd_reset – reset MySQL/MariaDB password for root user

  24. mysql_set_max_connections – set the max_connections option in MySQL configuration

  25. net_show_connections – show server connections

  26. reload_cwpsrv – reloads CWP

  27. restart_cwpsrv – restarts CWP

  28. restart_httpd – restarts the httpd service

  29. security_is_my_server_hacked – check services that are usually hacked

  30. softaculous_fix_update – it installs Softaculous script

  31. update_cwp – updates CWP to the latest version

    [root@cwp1 ~]# /scripts/update_cwp ==================================================== ============= CentOS Web Panel Cron ================ ==================================================== ########################### Firewall Flush Daily Blocks ########################### ###################### Update Server Packages ###################### [root@cwp1 ~]# 
  32. update_ioncube – ionCube installer/updater

  33. upgrade_mysql – updates MySQL and phpMyAdmin

  34. user_backup – backup users’ files and databases

  35. varnish_clear_cache – clears the varnish cache without restart 

  36. whoowns – displays the owner of a domain:

    [root@cwp1 ~]# /scripts/whoowns demo.plothost.com Checking User Accounts: demo Checking Addon Domains: Checking SubDomains: [root@cwp1 ~]# 

    You can also check our article on How to check if a domain is on the server  

Leave a Reply