Home > Linux > dcomments.blogs.m.mypapit_gnu_linux_blog [ Add to favorite]
|
|
|
|
Blog > newsgroup > comments > blog
|
|
![]() |
Here's a quick and dirty tips on how to find cause of heavy CPU resources usage on your Apache webserver (especially when running php scripts). First you need to locate the Apache 2 "access.log" file. By default in Ubuntu, this file is located in "/var/logs/apache2" directory. Then you need to run this command to find out which IP address accesses your website the most in a short time. CODE:
The output of the command should contain a list of IP addresses along with the number of hits it made in the last 10,000 access of your website CODE:
From here you can easily locate the offending ip address and proceed to block it from accessing your website further using .htaccess file or other blocking method. Here is an example to block certain ip address from accessing your website using .htaccess file CODE:
Save .htaccess file in the root directory of your web server (example /var/www), and the ip address wont be available to access your site again. Hope that would help you! |
Sat, 15 Nov 2008 |
||||
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||