#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    6
    Rep Power
    0

    Question 403 forbidden client denied by server configuration:


    Hi people

    I need some help about this little problem, simple but really annoying for me :x

    So I don't know where change the configuration of the settings who rules this problem

    When I have too many connection, I have this error 403 forbidden with this information into error.log
    "client denied by server configuration:"

    Here it's my apache2.conf related settings :

    Code:
    ##
    ## Server-Pool Size Regulation (MPM specific)
    ## 
    
    # 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 mpm_prefork_module>
    StartServers 8
    MinSpareServers 5
    MaxSpareServers 20
    ServerLimit      256
    MaxClients       256
    MaxRequestsPerChild 5000
    </IfModule>
    
    # worker MPM
    # StartServers: initial number of server processes to start
    # MaxClients: maximum number of simultaneous client connections
    # MinSpareThreads: minimum number of worker threads which are kept spare
    # MaxSpareThreads: maximum number of worker threads which are kept spare
    # ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
    #              graceful restart. ThreadLimit can only be changed by stopping
    #              and starting Apache.
    # ThreadsPerChild: constant number of worker threads in each server process
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule mpm_worker_module>
        StartServers          2
        MinSpareThreads      25
        MaxSpareThreads      75 
        ThreadLimit          64
        ThreadsPerChild      25
        MaxClients          150
        MaxRequestsPerChild   0
    </IfModule>
    
    # event MPM
    # StartServers: initial number of server processes to start
    # MaxClients: maximum number of simultaneous client connections
    # MinSpareThreads: minimum number of worker threads which are kept spare
    # MaxSpareThreads: maximum number of worker threads which are kept spare
    # ThreadsPerChild: constant number of worker threads in each server process
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule mpm_event_module>
        StartServers          2
        MaxClients          150
        MinSpareThreads      25
        MaxSpareThreads      75 
        ThreadLimit          64
        ThreadsPerChild      25
        MaxRequestsPerChild   0
    </IfModule>
    So if someone can help me I will be really happy ^^
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    What exactly are you trying to accomplish?
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    6
    Rep Power
    0
    Originally Posted by E-Oreo
    What exactly are you trying to accomplish?
    I want to avoid this error and increase the limit.

    Because I have this error many times when I administrate my website, and I saw some visitors have this error too
  6. #4
  7. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    Which MPM is your server using? You can get a list of modules by passing the -l flag to your httpd/apache2 binary.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    6
    Rep Power
    0
    Originally Posted by E-Oreo
    Which MPM is your server using? You can get a list of modules by passing the -l flag to your httpd/apache2 binary.
    Here it's the output =>

    Code:
    # /usr/sbin/apache2 -l
    Compiled in modules:
      core.c
      mod_log_config.c
      mod_logio.c
      prefork.c
      http_core.c
      mod_so.c
  10. #6
  11. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    OK, so that indicates that you're using prefork, so only the first configuration section matters.

    To increase the maximum number of clients that can be connected at the same time you need to increase ServerLimit and MaxClients. Right now this is set to 256.

    Note though that Apache is still obviously limited by the physical resources of your server. You don't want to increase the limit so much that you start causing performance issues on the server. If you're at that point, you either need more efficient code, a more powerful server, or more servers.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    6
    Rep Power
    0
    Originally Posted by E-Oreo
    OK, so that indicates that you're using prefork, so only the first configuration section matters.

    To increase the maximum number of clients that can be connected at the same time you need to increase ServerLimit and MaxClients. Right now this is set to 256.

    Note though that Apache is still obviously limited by the physical resources of your server. You don't want to increase the limit so much that you start causing performance issues on the server. If you're at that point, you either need more efficient code, a more powerful server, or more servers.
    Ok understood

    I will try to set only the first part of settings so.

    I saw I must "stop" then "start" apache2 to take in consideration those*
    change of settings
    I saw too, if I don't have any "ServerLimit" setting I can add it myself*
    into the conf file.

    Last, my dedicated server is powerfull, and I don't think I need to*
    change, for that I'm a bit disapointed is this change don't help ...
    I run apache into a dedicated server Intel Core i5-2400
    *@*3.10
    *Ghz with*
    4 cores (HT) and 16 gigas of ram

    Top's output :

    Code:
    top - 08:27:28 up 22 days, 12:27,* 1 user,* load average:*0.06
    ,*
    0.08
    ,*0.06
    
    Tasks: 269 total,** 1 running, 268 sleeping,** 0 stopped,** 0 zombie
    Cpu(s):*14.0
    %us,* 1.9%sy,* 0.0%ni,*84.1
    %id,* 0.0%wa,* 0.0%hi,* 0.0%si,**
    0.0%st
    Mem:**16367548
    k total,*16157640
    k used,***209908
    k free,***276308
    k buffers
    Swap:**5118972
    k total,***645272
    k used,**4473700
    k free,**5278584
    k*
    cached
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    6
    Rep Power
    0
    Arf still having this bug :/

    Here it's the error =>
    Code:
    Forbidden
    
    You don't have permission to access /index.php on this server.
    
    Apache/2.2.16 (Debian) PHP/5.3.3-7+squeeze8 with Suhosin-Patch mod_ssl/2.2.16 OpenSSL/0.9.8o Server at manager.n1-servers.fr Port 80
    and here it's the new settings I used into my apache2.conf =>

    Code:
    <IfModule mpm_prefork_module>
    StartServers 10
    MinSpareServers 10
    MaxSpareServers 20
    ServerLimit      1000
    MaxClients       1000
    MaxRequestsPerChild 5000
    </IfModule>

IMN logo majestic logo threadwatch logo seochat tools logo