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 ~]

#

check_postqueue – shows how many emails were deferred. Output:

[root@cwp1 ~]# /scripts/check_postqueue
37

[root@cwp1 ~]

#

checkdb – it checks the server for bad tables.

clamd_fix_100_cpu_usage – script will fix clamd 100% cpu usage on the centos 7 servers 

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 ~]

#

cwp_monitor – monitors CWP critical load

cwp_version – shows the CWP server version as:

[root@cwp1 ~]# /scripts/cwp_version
0.9.8.592

[root@cwp1 ~]

#

cwpsrv_rebuild_user_conf – recreates CWP configuration files and restarts CWP.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 ~]

# 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 ~]

#

generate_hostname_ssl – generates a self-signed certificate for the hostname. We don’t recommend to use this script. Check our article on how to Set up an SSL certificate for hostname on CentOS Web Panel

install_api – installs CWP API configuration

install_imagick – installs Imagick

install_maldet – installs Maldet

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

install_supportKey – installs the CWP SSH Support key

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 ~]

#

list_subdomains – lists all subdomains

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 ~]

# mail_queue_stats –  shows mail stats:

[root@cwp1 ~]# /scripts/mail_queue_stats
maildrop 0
incoming 0
hold 0
active 0
deferred 36

[root@cwp1 ~]

#

mysql_fix_myisam_tables – fix MyISAM tables

mysql_pwd_reset – reset MySQL/MariaDB password for root user

mysql_set_max_connections – set the max_connections option in MySQL configuration

net_show_connections – show server connections

reload_cwpsrv – reloads CWP

restart_cwpsrv – restarts CWP

restart_httpd – restarts the httpd service

security_is_my_server_hacked – check services that are usually hacked

softaculous_fix_update – it installs Softaculous script

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 ~]

#

update_ioncube – ionCube installer/updater

upgrade_mysql – updates MySQL and phpMyAdmin

user_backup – backup users’ files and databases

varnish_clear_cache – clears the varnish cache without restart 

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 ~]

#

Залишити відповідь

Ваша e-mail адреса не оприлюднюватиметься. Обов’язкові поля позначені *