Apache2 – Parameters, StartServers, MinSpareServers, etc

  • TimeOut Directive: Amount of time the server will wait for certain events before failing a request

The TimeOut directive defines the length of time Apache will wait for I/O in various circumstances:

  • When reading data from the client, the length of time to wait for a TCP packet to arrive if the read buffer is empty.
  • When writing data to the client, the length of time to wait for an acknowledgement of a packet if the send buffer is full.
  • In mod_cgi, the length of time to wait for output from a CGI script.
  • In mod_ext_filter, the length of time to wait for output from a filtering process.
  • In mod_proxy, the default timeout value if ProxyTimeout is not configured.
  • On virtualized servers like VPS servers, lowering this value to 100 can help improve performance.
  • KeepAlive: Enables HTTP persistent connections. High volume and/or load balanced servers should have this setting disabled (Off) to increase connection throughput.
  • MaxKeepAliveRequests: This setting works only if KeepAlive is enabled as well. This setting limits the number of requests allowed per persistent connection when KeepAlive is on. If it is set to 0, unlimited requests will be allowed.
  • KeepAliveTimeout: The number of seconds Apache will wait for another request before closing the connection. Setting this to a high value may cause performance problems in heavily loaded servers. The higher the timeout, the more server processes will be kept occupied waiting on connections with idle clients.
  • StartServers: is the number of Apache (httpd) processes that will be created upon startup
  • MinSpareServers: Minimum number of Servers kept on IDLE
  • MaxSpareServers: Max number of Server kept on IDLE.

 

Share Button

Apache2 – Access based on IP – http password access

How to allow/deny access based on IP address. Also how to use the htpasswd file

1) Access based on IP – See lines 9 to 11


    Options Indexes FollowSymLinks
    AllowOverride AuthConfig
    AuthType Basic
    AuthName "Authentication Required"
    Require valid-user
    AuthUserFile "/var/www/html/.htpasswd"
    #Require all granted
    Order deny,allow
    Deny from all
    Allow from 10.0.0.29


2) – http password access – See lines 3 to 7
The .htpasswd file will need to be told which users it should accept. You do this issuing the following command:

1
htpasswd -c .htpasswd gmastrokostas

    Options Indexes FollowSymLinks
    AllowOverride AuthConfig
    AuthType Basic
    AuthName "Authentication Required"
    Require valid-user
    AuthUserFile "/var/www/html/.htpasswd"
    #Require all granted
    Order deny,allow
    Deny from all
    Allow from 10.0.0.29


Share Button