Last update:
June 5, 2002

Presentation  
 
Presentation
Working conditions
Panel of servers

Apache  
 
Operation
Modules
Optimization solutions

Caching PHP  
 
Presentation
Pages caching
Opcodes caching

Example  
 
Optimization on Wysistat

Links  
 
Apache 1.3
PHP Accelerator
ID.fr
Mesure d'audience

Study and optimization
of a Web server

 

Apache version 1.3 operation

 

Configuration
Request processing steps
Structure of a module
Request processing


Configuration

The configuration of Apache is carried out via the file "httpd.conf". It contains commands which allow to tune the various parameters of the configuration of the server. This file is read by Apache at startup; therefore any modification of this file aiming at tuning certain parameters requires a restart of the server in order to be validated.


Request processing steps

The diagram below shows the succession of the processing steps:

URI -> Filename translation

The URI of requested document looks like /docs/myDocument.html and is present in the request headers (the URL of this document looks like http://www.mydomaine.com/docs/myDocument.html).
The internal path is
/var/httpd/apache/docs/myDocument.html.
Thus this step allows to convert the URI into filename or rather into internal path where can be found the document on the server.

 
Request headers parsing

The server analyzes HTTP headers of the request, which will allow him to carry out certain treatments according to these headers.

 
Access control

Access restrictions can be defined on the resources of the server, according to certain characteristics of the client (IP address, or hostname). For example, we can authorize the access to a given repertory only to the client whose IP address is 127.0.0.1 (access only from the machine where the server is installed). It is checked here that the characteristics of the client respect the access controls on the required resources. Des restrictions d'accès peuvent être définies sur les ressources du serveur, en fonction de certaines caractéristiques du client (en géneral son adresse IP, ou le nom de sa machine). Par exemple, on peut autoriser l'accès un répertoire donné uniquement aux clients dont l'adresse IP est 127.0.0.1 ( accès uniquement depuis la machine où est installé le serveur). On vérifie ici que les caractéristiques du client respectent les contrôles d'accès sur les ressources demandées.

 
Identity checking

Checks if the password and the login provided by the client exist and are valid [is the user who they say they are?] . On vérifie si le mot de passe et le login fournis par le client existent et sont valides (l'utilisateur est-il celui qu'il prétend être ?) .

 
Authorization access checking

Certain resources of the server are protected, in addition to the authentification by login and password, by certain directives: access only if the client is owner of the file, or only if he belongs to a user group given.... This step checks that the client has the permissions to access the file requested, if it is protected by the preceding directives.

 
Determining MIME type of the object requested

Determines the MIME type of the document required in order to carry out certain actions (for example if it is a CGI file, it will have to be treated consequently).

 
Sending a response back to the client.

The HTTP header of the response is made up and sent to the client, then it is the document itself (or the output of a treatment) which is sent to the client.

 
Logging the request

Records a trace of the transaction carried out by recording in one or more logfiles (according to the configuration of Apache) certain data of this transaction.

These steps are handled by looking at each of a succession of modules, looking to see if each of them has a handler for the phase.


Contact - version française