Results 1 to 13 of 13

Thread: Apache slow?

  1. #1
    Join Date
    Jul 2003
    Posts
    180

    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

  2. #2
    Join Date
    Dec 2002
    Location
    chica go go
    Posts
    11,876
    Have you checked your error_log for anything strange?

  3. #3
    Join Date
    Jul 2003
    Posts
    180
    Sorry for being such a newbie...but what is the command to check the log via SSH?

  4. #4
    Join Date
    Dec 2002
    Location
    chica go go
    Posts
    11,876
    try

    tail /var/log/httpd/error_log

    i'm not sure where apache2 stores error logs.

  5. #5
    Join Date
    Jul 2003
    Posts
    180
    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.

  6. #6
    Join Date
    Dec 2002
    Location
    chica go go
    Posts
    11,876
    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".

  7. #7
    Join Date
    Jul 2003
    Posts
    180
    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
    Last edited by sir_han; 12-17-2006 at 05:40 AM.

  8. #8
    Join Date
    Dec 2002
    Location
    chica go go
    Posts
    11,876
    Alright, now open that file, and just comment out the 401 line.

  9. #9
    Join Date
    Jul 2003
    Posts
    180
    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?

  10. #10
    Join Date
    Jul 2003
    Location
    Goleta, CA
    Posts
    5,566
    Maxclients should be (total system ram in megabytes / average size of apache process) - 10 or so

  11. #11
    Join Date
    Jul 2003
    Posts
    180
    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.

  12. #12
    Join Date
    Jul 2004
    Location
    Texas
    Posts
    688
    Any reason you're still running redhat 9?

  13. #13
    Join Date
    Jul 2003
    Posts
    180
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •