Home

Contents


What is Apache?

  • A HyperText Transfer Protocol (HTTP) server process. HTTP/1.1 Compliant.
  • The most popular freely available Web server which can also act a caching proxy server allowing access to the Internet from behind a firewall.
  • Apache has been developed as a modular product such that only those modules required need to be included.
  • The server can be either run as a daemon process or invoked by inetd each time a connection to the HTTP service is requested.
  • Apache can be configured to run multiple servers to spread its processing load, with the number of servers being dependant on the expected hit rate.
  • Apache is distributed in source code format, however binaries are available for many common Unix variants.
  • Versions tested: Apache 1.3.3, 1.2.4, 1.2b4, 1.1.1
  • Server platform tested: Solaris 2.6, 2.5.1 for x86
Return to Top of File


Example configuration sections

  • Restrict access to internal access only
    <Directory 'restricted directory here'>
      order deny,allow
      deny from all
      allow from 'your domain name here'
    </Directory>
    
  • Restrict access based on passwords
    <Directory 'restricted directory here'>
      AuthType Basic
      AuthName 'name of authorised group here'
      AuthGroupFile 'location of group file'
      AuthUserFile 'location of password file here'
      order deny,allow
      deny from all
      allow from 'your domain name here'
      require group 'name of authorised group here'
    </Directory>
    
  • Restrict access based on either passwords or internal access
    <Directory 'restricted directory here'>
      AuthType Basic
      AuthName 'name of authorised group here'
      AuthGroupFile 'location of group file'
      AuthUserFile 'location of password file here'
      order deny,allow
      deny from all
      allow from 'your domain name here'
      require group 'name of authorised group here'
      satisfy any
    </Directory>
    
  • Restrict access to external locations
    <Location 'restricted URL here'>
      order deny,allow
      deny from all
    </Location>
    
  • Disable directory listings of those directories not containing a Directory Index file at the server level, but allow directory listings on specific directories.
    <Directory 'DocumentRoot here'>
      Options FollowSymLinks
    </Directory>
    
    <Directory 'Directory to allow indexing on here'>
      Options +Indexes
    </Directory>
    
  • Forward all URL requests to a remote server, for example to access its cache manager. As only http proxy request are currently supported, none http requests (eg., ftp) will be encapsulated as http proxy requests.
    ProxyRemote * http://'Remote server here':'Remote port here'
    
Return to Top of File


Tips & Tricks

  • In order to speed up handling of requests the number of directories through which Apache has to search for .htaccess files should be minimised. Searching starts from the root directory downwards. Therefore the AllowOverride option should be turned off at the root directory and only turned on at the directory level required.
    <Directory />
      AllowOverride None
    </Directory>
    
    <Directory 'Directory to allow .htaccess file in here'>
      AllowOverride All
    </Directory>
    
  • The modules which are included in a particular Apache executable can be determined by use of the -l option.
    httpd -l
    
  • To enable the server to display current details about how well it is performing and what it is doing, the status module must be included. This is achieved by ensuring the following lines in the file 'Configuration' are uncommented prior to compiling the source code
    Rule STATUS=yes
    Module status_module mod_status.o
    
    and by the addition of lines similar to the following in the configuration file 'access.conf', which allows access to the URL http://'your server name here'/server-status from your domain only
    <Location /server-status>
      SetHandler server-status
      order deny,allow
      deny from all
      allow from 'your domain name here'
    </Location>
    
  • To enable the server to display its current configuration informtion and all included modules, the info module must be included. This is achieved by ensuring the following lines in the file 'Configuration' are uncommented prior to compiling the source code
    Module info_module mod_info.o
    
    and by the addition of lines similar to the following in the configuration file 'access.conf', which allows access to the URL http://'your server name here'/server-info from your domain only
    <Location /server-info>
      SetHandler server-info
      order deny,allow
      deny from all
      allow from 'your domain name here'
    </Location>
    
Return to Top of File


More information

Return to Top of File