From: Daniel Gruno Date: Sat, 5 May 2012 05:57:49 +0000 (+0000) Subject: Update syntax highlighting for French translation X-Git-Tag: 2.5.0-alpha~6899 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8496148210cd90ea9118ad59959b15b37f9beca1;p=thirdparty%2Fapache%2Fhttpd.git Update syntax highlighting for French translation git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1334321 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/misc/perf-tuning.xml.fr b/docs/manual/misc/perf-tuning.xml.fr index 9e91e58d02b..76c27c74dcc 100644 --- a/docs/manual/misc/perf-tuning.xml.fr +++ b/docs/manual/misc/perf-tuning.xml.fr @@ -164,14 +164,12 @@ Voici un exemple qui désactive les recherches DNS sauf pour les fichiers .html et .cgi :

- - HostnameLookups off
- <Files ~ "\.(html|cgi)$">
- - HostnameLookups on
-
- </Files> -
+ +HostnameLookups off +<Files ~ "\.(html|cgi)$"> + HostnameLookups on +</Files> +

Mais même dans ce cas, si vous n'avez besoin de noms DNS que dans certains CGIs, vous pouvez effectuer l'appel à gethostbyname @@ -190,14 +188,12 @@ symboliques. Un appel supplémentaire par élément du chemin du fichier. Par exemple, si vous avez :

- - DocumentRoot /www/htdocs
- <Directory />
- - Options SymLinksIfOwnerMatch
-
- </Directory> -
+ +DocumentRoot /www/htdocs +<Directory /> + Options SymLinksIfOwnerMatch +</Directory> +

et si une requête demande l'URI /index.html, Apache effectuera un appel à lstat(2) pour @@ -208,20 +204,16 @@ vérifier la sécurité des liens symboliques, vous pouvez utiliser une configuration du style :

- - DocumentRoot /www/htdocs
- <Directory />
- - Options FollowSymLinks
-
- </Directory>
-
- <Directory /www/htdocs>
- - Options -FollowSymLinks +SymLinksIfOwnerMatch
-
- </Directory> -
+ +DocumentRoot /www/htdocs +<Directory /> + Options FollowSymLinks +</Directory> + +<Directory /www/htdocs> + Options -FollowSymLinks +SymLinksIfOwnerMatch +</Directory> +

Ceci évite au moins les vérifications supplémentaires pour le chemin défini par DocumentRoot. Notez que @@ -246,14 +238,12 @@ pour chaque élément du chemin du fichier demandé. Par exemple, si vous avez :

- - DocumentRoot /www/htdocs
- <Directory />
- - AllowOverride all
-
- </Directory> -
+ +DocumentRoot /www/htdocs +<Directory /> + AllowOverride all +</Directory> +

et qu'une requête demande l'URI /index.html, Apache tentera d'ouvrir /.htaccess, /www/.htaccess, @@ -275,15 +265,15 @@ Il y a cependant un cas dans lequel vous pouvez accélérer le serveur. Au lieu d'utiliser une directive générique comme :

- + DirectoryIndex index - +

utilisez une liste explicite d'options :

- + DirectoryIndex index.cgi index.pl index.shtml index.html - +

où vous placez le choix courant en première position.

@@ -628,39 +618,29 @@ (ces exemples ne sont pas extraits du code d'Apache, ils ne sont proposés qu'à des fins pédagogiques) :

- - for (;;) {
- - for (;;) {
- - fd_set accept_fds;
-
- FD_ZERO (&accept_fds);
- for (i = first_socket; i <= last_socket; ++i) {
- - FD_SET (i, &accept_fds);
-
- }
- rc = select (last_socket+1, &accept_fds, NULL, NULL, NULL);
- if (rc < 1) continue;
- new_connection = -1;
- for (i = first_socket; i <= last_socket; ++i) {
- - if (FD_ISSET (i, &accept_fds)) {
- - new_connection = accept (i, NULL, NULL);
- if (new_connection != -1) break;
-
- }
-
- }
- if (new_connection != -1) break;
-
- }
- process the new_connection;
-
- } -
+ +for (;;) { + for (;;) { + fd_set accept_fds; + + FD_ZERO (&accept_fds); + for (i = first_socket; i <= last_socket; ++i) { + FD_SET (i, &accept_fds); + } + rc = select (last_socket+1, &accept_fds, NULL, NULL, NULL); + if (rc < 1) continue; + new_connection = -1; + for (i = first_socket; i <= last_socket; ++i) { + if (FD_ISSET (i, &accept_fds)) { + new_connection = accept (i, NULL, NULL); + if (new_connection != -1) break; + } + } + if (new_connection != -1) break; + } + process the new_connection; +} +

Mais cette implémentation rudimentaire présente une sérieuse lacune. Rappelez-vous que les processus enfants exécutent cette boucle au même @@ -699,41 +679,31 @@ entrées dans la boucle interne. La boucle ressemble à ceci (les différences sont mises en surbrillance) :

- - for (;;) {
- - accept_mutex_on ();
- for (;;) {
- - fd_set accept_fds;
-
- FD_ZERO (&accept_fds);
- for (i = first_socket; i <= last_socket; ++i) {
- - FD_SET (i, &accept_fds);
-
- }
- rc = select (last_socket+1, &accept_fds, NULL, NULL, NULL);
- if (rc < 1) continue;
- new_connection = -1;
- for (i = first_socket; i <= last_socket; ++i) {
- - if (FD_ISSET (i, &accept_fds)) {
- - new_connection = accept (i, NULL, NULL);
- if (new_connection != -1) break;
-
- }
-
- }
- if (new_connection != -1) break;
-
- }
- accept_mutex_off ();
- process the new_connection;
-
- } -
+ +for (;;) { + accept_mutex_on (); + for (;;) { + fd_set accept_fds; + + FD_ZERO (&accept_fds); + for (i = first_socket; i <= last_socket; ++i) { + FD_SET (i, &accept_fds); + } + rc = select (last_socket+1, &accept_fds, NULL, NULL, NULL); + if (rc < 1) continue; + new_connection = -1; + for (i = first_socket; i <= last_socket; ++i) { + if (FD_ISSET (i, &accept_fds)) { + new_connection = accept (i, NULL, NULL); + if (new_connection != -1) break; + } + } + if (new_connection != -1) break; + } + accept_mutex_off (); + process the new_connection; +} +

Les fonctions accept_mutex_on et accept_mutex_off @@ -846,39 +816,31 @@ http_main.c). La fonction ressemble approximativement à ceci :

- - void lingering_close (int s)
- {
- - char junk_buffer[2048];
-
- /* shutdown the sending side */
- shutdown (s, 1);
-
- signal (SIGALRM, lingering_death);
- alarm (30);
-
- for (;;) {
- - select (s for reading, 2 second timeout);
- if (error) break;
- if (s is ready for reading) {
- - if (read (s, junk_buffer, sizeof (junk_buffer)) <= 0) {
- - break;
-
- }
- /* just toss away whatever is here */
-
- }
-
- }
-
- close (s);
-
- } -
+ +void lingering_close (int s) +{ + char junk_buffer[2048]; + + /* shutdown the sending side */ + shutdown (s, 1); + + signal (SIGALRM, lingering_death); + alarm (30); + + for (;;) { + select (s for reading, 2 second timeout); + if (error) break; + if (s is ready for reading) { + if (read (s, junk_buffer, sizeof (junk_buffer)) <= 0) { + break; + } + /* just toss away whatever is here */ + } + } + + close (s); +} +

Ceci ajoute naturellement un peu de charge à la fin d'une connexion, mais s'avère nécessaire pour une implémentation fiable. Comme HTTP/1.1 diff --git a/docs/manual/misc/security_tips.xml.fr b/docs/manual/misc/security_tips.xml.fr index 466340ad9a3..88ad6b9d06a 100644 --- a/docs/manual/misc/security_tips.xml.fr +++ b/docs/manual/misc/security_tips.xml.fr @@ -336,11 +336,11 @@

Ajoutez dans le fichier de configuration du serveur

- - <Directory />
- AllowOverride None
- </Directory> -
+ +<Directory /> + AllowOverride None +</Directory> +

Ceci interdit l'utilisation des fichiers .htaccess dans tous les répertoires, sauf ceux pour lesquels c'est explicitement @@ -369,28 +369,28 @@ fichiers. Pour l'éviter, ajoutez le bloc suivant à la configuration de votre serveur :

- - <Directory />
- Order Deny,Allow
- Deny from all
- </Directory> -
+ +<Directory /> +Order Deny,Allow +Deny from all +</Directory> +

ceci va interdire l'accès par défaut à tous les fichiers du système de fichiers. Vous devrez ensuite ajouter les blocs Directory appropriés correspondant aux répertoires auxquels vous voulez autorisez l'accès. Par exemple,

- - <Directory /usr/users/*/public_html>
- Order Deny,Allow
- Allow from all
- </Directory>
- <Directory /usr/local/httpd>
- Order Deny,Allow
- Allow from all
- </Directory> -
+ +<Directory /usr/users/*/public_html> + Order Deny,Allow + Allow from all +</Directory> +<Directory /usr/local/httpd> + Order Deny,Allow + Allow from all +</Directory> +

Portez une attention particulière aux interactions entre les directives Location et @@ -405,9 +405,9 @@ fortement d'inclure la ligne suivante dans le fichier de configuration de votre serveur :

- + UserDir disabled root - + @@ -453,12 +453,12 @@ qui signifie que vous avez probablement mis en commentaire ce qui suit dans le fichier de configuration de votre serveur :

- - <Files ".ht*">
- Order allow,deny
- Deny from all
- </Files> -
+ +<Files ".ht*"> + Order allow,deny + Deny from all +</Files> +