My Freebsd server got many DoS attacks recently, which caused Apache or Mysql to stop serving normal connections. When mysql reached its max connections, my application will send me an email about each mysql error, so I can block evil IPs. But when Apache refuses connections, I wouldn't know about it unless I'm visiting the site myself. Is it possible to know when Apache reaches its max connections? So that I can tune Apache or block malicious IPs? Thanks!
|
Well, the general solution would be to add some external monitoring. One approach might be to run your own Nagios server. There is definitely some effort in setting it up, but on the other hand it will also allow you to do all kinds of monitoring. A perhaps easier solution would be to use some third party monitoring service such as was it up? or pingdom. In addition to making sure your server response to http it's a good thing to also verify that the response page contain some expected phrase or so. That way you get some verification on that also the underlaying application layer is somewhat working. |
|||||||
|
|
I believe that mod_status will be able to give you the info you need, though it won't be as useful if Apache is refusing connections: http://httpd.apache.org/docs/2.2/mod/mod_status.html Apachetop should also be able to tell you the current number of connections. It's available in most repositories. The best way, however, may be just to script a |
|||
|
|
|
||||
|
|