-
Apache slow?
Hi I recently notice a slowness when accessing my sites on my dedicated servers. Here's how it goes. I rebooted the system and everything runs normal. After 5 minutes, the slowness begins. Then I'm not able to access any of the sites on the server at all. During the meantime, FTP-ing is working normal. I stopped Apache and restarted it, problem fixed. Then after few minutes, it slows and stalls again. Any ideas where to begin?
System:
Redhat Linux 9.0
Apache version 2.0.40
-
Have you checked your error_log for anything strange?
-
Sorry for being such a newbie...but what is the command to check the log via SSH?
-
try
tail /var/log/httpd/error_log
i'm not sure where apache2 stores error logs.
-
Code:
[root@ns1 root]# tail /var/log/httpd/error_log
[Sun Dec 17 02:33:51 2006] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!
[Sun Dec 17 02:33:51 2006] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!
[Sun Dec 17 02:33:51 2006] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!
[Sun Dec 17 02:33:51 2006] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!
[Sun Dec 17 02:33:51 2006] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!
[Sun Dec 17 02:33:51 2006] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!
[Sun Dec 17 02:33:51 2006] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!
[Sun Dec 17 02:33:51 2006] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!
[Sun Dec 17 02:33:51 2006] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!
[Sun Dec 17 02:33:51 2006] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!
This is what I get when I check the log.
-
Well, that's a hint. Could you try and figure out where you are declaring the full-url as the 401 errordocument. Could be httpd.conf, could be one of your accounts' .htaccess file.
here's a hint
find /home -name .htaccess -exec grep -Hi "ErrorDocument 401" {} \;
That'll show you every .htaccess file that contains "ErrorDocument 401".
-
Found only 1 result. Looks like it's in one of the domains.
Code:
/home/*DOMAIN_NAME*/public_html/.htaccess:ErrorDocument 401 *URL*
I've deleted the .htaccess in that domain. Restarted Apache......same thing still happen. In addition, I checked the log again and found this:
Code:
[Sun Dec 17 03:00:21 2006] [error] server reached MaxClients setting, consider raising the MaxClients setting
-
Alright, now open that file, and just comment out the 401 line.
-
I've deleted the .htaccess file instead. There seems to be no more error reporting the "401 document error" anymore...which is good.
About the MaxClient error....I've checked my httpd.conf file and here is what is in it:
Code:
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule prefork.c>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
MaxClients 150
MaxRequestsPerChild 1000
</IfModule>
MaxClients = 150...is that normal?
-
Maxclients should be (total system ram in megabytes / average size of apache process) - 10 or so
-
This morning, I've set the MaxClient to 150, which is the default. Restarted Apache and the server seems fine. I believe my server was being attack last night, possibly a dos attack or some sort.
-
Any reason you're still running redhat 9?
-
No. Simply put, I haven't move to a new host or upgrade servers for few years now. Too lazy to do it anytime soon. I know I should.