cPanel Config

Welcome to cPanelConfig the fastest growing cPanel configuration and troubleshooting guide on the internet. Please take the time and register. We would love to have your contribution to this completely free cPanel resource. We are updating this daily so be sure to visit us on a regular basis.

Apache reading = DOS attack ?

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Posted by yolau

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:

  1. Log on your server as root
  2. Type the fallowing command
  3. 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.

  4. 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
  5. apf -d IP
    or
    csf -d IP

Hope it helps !

If you have any questions don’t hesitate to leave a comment.

Share this:
  • Digg
  • del.icio.us
  • Slashdot
  • StumbleUpon
  • Netvouz
  • description
  • ThisNext
  • MisterWong
  • Wists
  • De.lirio.us
  • Furl
  • MyShare
  • Smarking
  • Technorati
  • YahooMyWeb

If you enjoyed this post, make sure you subscribe to my RSS feed!

6 Responses to “Apache reading = DOS attack ?”

  1. 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.

  2. 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.

  3. 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.

  4. try netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n

  5. Thanks for the csf -d command, saves a load of time :)

  6. 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?

Leave a Reply