cpanel and docs
less /proc/meminfo -------> ram info
5sOSW..q89v8M
/var/cpanel/accounting.log --------cpanel create/deletion logs.
/var/log/pslog -----------store the result of various commands
>> PHP error logs: Home folder of the domain >> logs >> PHP log
>> Apache error logs: /usr/local/apache/logs/error_log
/usr/local/cpanel/logs/login_log ------------cpanel login logs
Access logs:
less /usr/local/cpanel/logs/access_log | grep 40.180.1.235
less /usr/local/apache/logs/domlogs/taxichoice.co.za | grep 40.180.1.235
telnet IP 587 -----Check telnet
domian history: cpacc domain
New tool to check domain history - cpacc
ips applyfpm wsignaf ---restart fpm
find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \; ----permission
sar Command:
-q Queue length and load average statistics
-r Memory utilization statistics
-R Memory statistics
-S Swap space utilization statistics
ips cwd ----to check the number of mails send from the website recently
quota -s username -------disk space usage
cpl -q ---- CWP disk quota usage
sudo sh -c "/usr/local/afribin/cpl-q username "
du -h --max-depth=1 -------list folders using most size.
Details quota stats: sudo sh -c "cpuser_spacecheck cpanelusername"
php -i | grep php.ini ------php.ini file
/opt/cpanel/ea-php56/root/etc/php.ini
rsync -avz --rsh="ssh -p 24" /var/vmail/ettcoprojects.co.za/ root@154.0.168.249:/home/ettcolas/mail/ettcoprojects.co.za/ ------rsynch
scp path/to/local/file.ext user@remote-host:path/to/remote/file.ext
scp /backup/graveyard/luigi.aserv.co.za/cpmove-letcogqt.tar.gz 197.242.144.229:/home -----copy file
/scripts/restorepkg /home/cpmove-letcogqt.tar.gz ----restore account using that file.
/scripts/pkgacct redanezf -------create full backup of the domain.
/scripts/pkgacct --skiphomedir username -----create skeleton backup.
find . -printf "%h\n" | cut -d/ -f-2 | sort | uniq -c | sort -rn ---inode usage breakdown
email queue:
exim -qff -v
spamnuke - clear spam from queue.
domain hitting php limits: sudo sh -c "cpl innovationmediadesign8.co.za | grep PHP-FPM-LIMITS-HIT"
Bandwidth hits: less /usr/local/apache/domlogs/domain_name/ | awk {'print $1'} | sort -n | uniq -c | sort -n
Check files using large space: find /home -maxdepth 3 -type f -size +100000k -exec ls -lh {} \;
Search in folder to check for any words in any files: grep -irl name
https://www.inmotionhosting.com/support/website/server-usage/determine-cause-of-server-usage-spike/
check number of hits during a time: egrep "15/Jan/2013:14:09|15/Jan/2013:14:10" /home/userna5/access-logs/example.com | wc -l
Fix scanner issue: /usr/local/afribin/configs/clamd_sane.sh
List emails older than 1 year
find /home/user/mail/domain/email/cur/ -mtime +365 -exec mv -v {} /home/user/backup_emails/info/cur {} \;
find /home/user/mail/domain/email/.Sent/cur/ -mtime +365 -exec mv -v {} /home/user/backup_emails/info/.Sent/cur {} \;
Check number of files inside a folder: ls | wc -l
cupcake: ssh2 justin.m@cupcake.afrihost.com -p 24
Gdrive upload:
curl gdrive.sh | bash -s <id>
Kill ping to an external IP from our server: ps aux | grep 129.232.199.72
kill -9 process_id
Open ports: netstat -tulpn | grep LISTEN
======================================
To change dedicated IP to shared IP:
netstat -plane | grep :80
if nginx is listening,
check if entry for the Dedicated IP is there in:
/etc/nginx/custom_rules
/etc/nginx/custom_local
======================================
DOMLOG
cd /usr/local/apache/domlogs/username
less sasol.com | grep "POST" | awk '{ print $1}' | sort -n | uniq -c | sort -n
Disable/Enable shell_exec
vi /opt/cpanel/ea-php73/root/etc/php-fpm.d/domain.conf
restart php-fpm
unable to change the password or create email accounts for the domain.
While creating or changing, we are getting a red line under the password tab:
==
/scripts/upcp --force
==
Imagick:
extension=imagick.so -- add in the .user.ini file.
convert -version
“JSONParse error”, while opening the WHM/cPanels of our servers.
—
/scripts/restartsrv_queueprocd –stop
rm -fv /var/cpanel/taskqueue/servers_*json
/scripts/restartsrv_queueprocd –start
—
spetool domain ------e routing check lumberjack
scheme -l domain/ip/host ----------root password or whm link to log in to server.
frob rebuild -------after php version upgrade.
frob login ------wp dashboard.
dig domain @new_nameserver MX/A -------check what record is set in the remote NS side.
firefox profile: curl -s http://sysadmin.cpiv.com/scripts/compatibility.sh | /bin/bash
whmapi command to whitelist a sender address in all domains in a managed server:
for i in `cat /etc/trueuserdomains | awk {'print $NF'}` ; do echo "whitelist_from *@accounting.sageone.co.za" >> /home/$i/.spamassassin/user_prefs ; done
Immutable:
chattr -i filename
https://www.tecmint.com/chattr-command-examples/
Load
cd /var/log/sa
sar -q -f
/SCREEN
screen -S name
Run the command.
Ctrl-a + d: It detach a screen session without stopping it.
screen -r 200225
screen -ls --- list of sessions
CTRL+A+ESC - Enable scroll option
Comments
Post a Comment