Apache reading = DOS attack ?
If you are seeing many “? ..reading..” when your are clicking on Apache status in WHM and your Apache server is slow, there is a chance that your http server is under a dos attach.
You can check this out by:
- Log on your server as root
- Type the fallowing command
- If any IP’s have more then 100 connections then there is a chance that this is your attacker. Go ahead and block this IP using APF if you have it installed or CSF
netstat -plan|grep :80|awk {’print $5′}|cut -d: -f 1|sort|uniq -c|sort -n
You will see a list of IP’s with the number of connections each once has to your server.
apf -d IP
or
csf -d IP
Hope it helps !
If you have any questions don’t hesitate to leave a comment.
If you enjoyed this post, make sure you subscribe to my RSS feed!
- December 17th


















Do Hardware Firewalls protect against this type of attack? It’s been happening often for me, but every time I get a chance to check the IPs seem to be of customers.
Hi,
I tried to use the suggested script but I’m getting an error.
I’m trying to run this script:
netstat -plan|grep :80|awk {’print $5′}|cut -d: -f 1|sort|uniq -c|sort -n
However, I’m getting the following error:
:/root # netstat -plan|grep :80|awk {print $5?} |cut -d: -f 1|sort|uniq -c|sort -n
awk: cmd. line:2: (END OF FILE)
awk: cmd. line:2: syntax error
Any pointers on why is awk complaining ?
thanks,
-Sup.
netstat -plan|grep :80| awk {’print $5′} |cut -d: -f 1|sort|uniq -c|sort -n
I don’t know why, but copy/paste of the script in the example is showing a QuestionMark symbol when pasted into SSH.
I pasted the correct syntax here again.
Your script works great. There is some bizzare behavior that I don’t know why it fails on a simple Copy/Paste from this site.
-Sup.
try netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n
Thanks for the csf -d command, saves a load of time
is there any way to disable keepalive in Apache/2.2.10.
can i limit max ? ..reading.. connection?
i found many connection is open for OPTIONS * HTTP/1.0 what is it doing?