df -h
Make sure you have enough disk space
htop top (shift + m) free -m
Use Htop
Check for processes that are taking up a lot of memory/CPU and Check you’re not out of memory
grep 500 /var/log/apache2/error.log | less
Look for 500 errors caused by erroneous code on the server
grep MaxClients /var/log/apache2/error.log
Check for MaxClients warningdamn in your apache error logs
ls -lrt /var/log/
the -lrt flag will show you the most recently modified files at the end
ls -la /var/spool/cron/* ls -la /etc/cron* crontab -l
You might find your server is going down at a certain time, this could be result of a cronjob eating up too many resources
dmesg
df -i
Check inodes remaining when you have a disk that looks full but is reporting free space
ps -e | grep apache2 | wc -l
For DOS attacks:
netstat -ant | egrep -i '(ESTABLISHED|WAIT|CLOSING)' | wc -l
netstat -ant | egrep -i '(SYN)' | wc -l
netstat -ant | egrep -i '(LISTEN)'
cat /proc/$PID/cmdline
For DOS attacks: END