in which it matters: If you are using <a href="howto/ssi.html">Server
Side Includes</a>;</p>
- <div class="example"><pre>
-<!-- The following include can be cached -->
+ <div class="example"><pre><!-- The following include can be cached -->
<!--#include virtual="/footer.html" -->
<!-- The following include can not be cached -->
the difference in the time it takes to read a file for the first time
and the second time;</p>
- <div class="example"><pre>
-colm@coroebus:~$ time cat testfile > /dev/null
+ <div class="example"><pre>colm@coroebus:~$ time cat testfile > /dev/null
real 0m0.065s
user 0m0.000s
sys 0m0.001s
<p>Caching of this type is enabled via;</p>
- <div class="example"><pre>
-# Enable memory caching
+ <div class="example"><pre># Enable memory caching
CacheEnable mem /
# Limit the size of the cache to 1 Megabyte
<p>Typically the module will be configured as so;</p>
- <div class="example"><pre>
-CacheRoot /var/cache/apache/
+ <div class="example"><pre>CacheRoot /var/cache/apache/
CacheEnable disk /
CacheDirLevels 2
CacheDirLength 1</pre></div>
En général, cela n'a que peu d'effet, à moins que vous n'utilisiez les
<a href="howto/ssi.html">Inclusions Côté Serveur (SSI)</a>;</p>
- <div class="example"><pre>
-<!-- L'inclusion suivante peut être mise en cache -->
+ <div class="example"><pre><!-- L'inclusion suivante peut être mise en cache -->
<!--#include virtual="/footer.html" -->
<!-- L'inclusion suivante ne peut pas être mise en cache -->
temps nécessaire à la première lecture d'un fichier et le temps
nécessaire à sa deuxième lecture;</p>
- <div class="example"><pre>
-colm@coroebus:~$ time cat testfile > /dev/null
+ <div class="example"><pre>colm@coroebus:~$ time cat testfile > /dev/null
real 0m0.065s
user 0m0.000s
sys 0m0.001s
<p>La mise en cache selon cette méthode est activée comme suit :</p>
- <div class="example"><pre>
-# Activation de la mise en cache en mémoire
+ <div class="example"><pre># Activation de la mise en cache en mémoire
CacheEnable mem /
# Limite la taille du cache à 1 Mégaoctet
<p>Typiquement, le module sera configuré comme suit :</p>
- <div class="example"><pre>
-CacheRoot /var/cache/apache/
+ <div class="example"><pre>CacheRoot /var/cache/apache/
CacheEnable disk /
CacheDirLevels 2
CacheDirLength 1</pre></div>
</code></p><pre>int header_only; /* HEAD request, as opposed to GET */
char *protocol; /* Protocol, as given to us, or HTTP/0.9 */
char *method; /* GET, HEAD, POST, <em>etc.</em> */
-int method_number; /* M_GET, M_POST, <em>etc.</em> */
-
-</pre><p><code>
+int method_number; /* M_GET, M_POST, <em>etc.</em> */</pre><p><code>
/* Info for logging */<br />
<br />
char *the_request;<br />
same set of filters as the main request. A graphical representation
might help:</p>
-<div class="example"><pre>
-Default_handler --> includes_filter --> byterange --> ...
-</pre></div>
+<div class="example"><pre>Default_handler --> includes_filter --> byterange --> ...</pre></div>
<p>If the includes filter creates a sub request, then we don't want the
data from that sub-request to go through the includes filter, because it
might not be SSI data. So, the subrequest adds the following:</p>
-<div class="example"><pre>
-Default_handler --> includes_filter -/-> byterange --> ...
+<div class="example"><pre>Default_handler --> includes_filter -/-> byterange --> ...
/
-Default_handler --> sub_request_core
-</pre></div>
+Default_handler --> sub_request_core</pre></div>
<p>What happens if the subrequest is SSI data? Well, that's easy, the
<code>includes_filter</code> is a resource filter, so it will be added to
will be called in.</p>
<p>This is the code that was added to <code>mod_mmap_static</code>:</p>
- <div class="example"><pre>
-static void register_hooks(void)
+ <div class="example"><pre>static void register_hooks(void)
{
static const char * const aszPre[]={ "http_core.c",NULL };
ap_hook_post_config(mmap_post_config,NULL,NULL,HOOK_MIDDLE);
creating your module definition. The old defintion looked
like</p>
- <div class="example"><pre>
-module MODULE_VAR_EXPORT <var>module_name</var>_module =
+ <div class="example"><pre>module MODULE_VAR_EXPORT <var>module_name</var>_module =
{
STANDARD_MODULE_STUFF,
/* initializer */
};</pre></div>
<p>The new structure is a great deal simpler...</p>
- <div class="example"><pre>
-module MODULE_VAR_EXPORT <var>module_name</var>_module =
+ <div class="example"><pre>module MODULE_VAR_EXPORT <var>module_name</var>_module =
{
STANDARD20_MODULE_STUFF,
/* create per-directory config structures */
<p>以下は、<code>mod_mmap_static</code> に追加したコードです:</p>
- <div class="example"><pre>
-static void register_hooks(void)
+ <div class="example"><pre>static void register_hooks(void)
{
static const char * const aszPre[]={ "http_core.c",NULL };
ap_hook_post_config(mmap_post_config,NULL,NULL,HOOK_MIDDLE);
<p>モジュールの定義を作成する際に注意しなければならない
ステージの数は激減しています。古い定義は次のようになっていました。</p>
- <div class="example"><pre>
-module MODULE_VAR_EXPORT <var>module_name</var>_module =
+ <div class="example"><pre>module MODULE_VAR_EXPORT <var>module_name</var>_module =
{
STANDARD_MODULE_STUFF,
/* initializer */
};</pre></div>
<p>新しい構造体はとってもシンプルです…</p>
- <div class="example"><pre>
-module MODULE_VAR_EXPORT <var>module_name</var>_module =
+ <div class="example"><pre>module MODULE_VAR_EXPORT <var>module_name</var>_module =
{
STANDARD20_MODULE_STUFF,
/* create per-directory config structures */
<h2><a name="security" id="security">The Security Phase</a></h2>
<p>Needs Documentation. Code is:</p>
- <div class="example"><pre>
-switch (ap_satisfies(r)) {
+ <div class="example"><pre>switch (ap_satisfies(r)) {
case SATISFY_ALL:
case SATISFY_NOSPEC:
if ((access_status = ap_run_access_checker(r)) != 0) {
httpd.conf to deal with known client problems. Since the affected clients
are no longer seen in the wild, this configuration is likely no-longer
necessary.</p>
-<div class="example"><pre>
-#
+<div class="example"><pre>#
# The following directives modify normal HTTP response behavior.
# The first directive disables keepalive for Netscape 2.x and browsers that
# spoof it. There are known problems with these browser implementations.
httpd.conf に次の行を加えるよう推奨されていましたが、
今となっては、問題としていたクライアントは実際には見かけることは
なくなってきたので、この設定はもはや必要ないかもしれません。</p>
-<div class="example"><pre>
-#
+<div class="example"><pre>#
# The following directives modify normal HTTP response behavior.
# The first directive disables keepalive for Netscape 2.x and browsers that
# spoof it. There are known problems with these browser implementations.
これを変更することで、特定のディレクトリのログ収集をやめたり、
特定のホストからのリクエストのログ収集をやめたりすることが簡単にできます。
</p>
- <div class="example"><pre>
-SetEnvIf Request_URI \.gif image-request
+ <div class="example"><pre>SetEnvIf Request_URI \.gif image-request
SetEnvIf Request_URI \.jpg image-request
SetEnvIf Request_URI \.png image-request
CustomLog logs/access_log common env=!image-request</pre></div>
これは推奨されている設定ではありませんが、ある限定された状況では有効です。
ここでは、すべての画像は <code>/web/images</code>
というディレクトリにあると仮定します。</p>
- <div class="example"><pre>
-SetEnvIf Referer "^http://www.example.com/" local_referal
+ <div class="example"><pre>SetEnvIf Referer "^http://www.example.com/" local_referal
# Allow browsers that do not send Referer info
SetEnvIf Referer "^$" local_referal
<Directory /web/images>
<p>Ŭ¶óÀÌ¾ðÆ®µéÀÇ ÀÌ¹Ì ¾Ë·ÁÁø ¹®Á¦¸¦ ÇØ°áÇϱâÀ§ÇØ
httpd.conf¿¡ ´ÙÀ½ ³»¿ëÀ» Æ÷ÇÔÇÏ±æ ¹Ù¶õ´Ù.</p>
-<div class="example"><pre>
-#
+<div class="example"><pre>#
# ´ÙÀ½ Áö½Ã¾îµéÀº ÀϹÝÀûÀÎ HTTP ÀÀ´äÀ» º¯°æÇÑ´Ù.
# ù¹øÂ° Áö½Ã¾î´Â Netscape 2.x¿Í À̸¦ °¡ÀåÇÑ ºê¶ó¿ìÀú¿¡°Ô
# keepalive¸¦ »ç¿ëÇÏÁö ¾Ê´Â´Ù. ÀÌµé ºê¶ó¿ìÀú ±¸Çö¿¡ ¹®Á¦°¡ ÀÖ´Ù.
<p>ÀÌ ¿¹Á¦´Â À̹ÌÁö¿¡ ´ëÇÑ ¿äûÀ» Á¢±Ù ·Î±×¿¡ ±â·ÏÇÏÁö
¾Ê´Â´Ù. ƯÁ¤ µð·ºÅ丮¿¡ ´ëÇÑ È¤Àº ƯÁ¤ È£½ºÆ®¿¡¼ ¿Â
¿äûÀ» ·Î±×ÇÏÁö ¾Êµµ·Ï ½±°Ô ¼öÁ¤ÇÒ ¼ö ÀÖ´Ù.</p>
- <div class="example"><pre>
-SetEnvIf Request_URI \.gif image-request
+ <div class="example"><pre>SetEnvIf Request_URI \.gif image-request
SetEnvIf Request_URI \.jpg image-request
SetEnvIf Request_URI \.png image-request
CustomLog logs/access_log common env=!image-request</pre></div>
¼³Á¤À» ±ÇÀåÇÏÁö´Â ¾ÊÀ¸¸ç, Á¦ÇÑµÈ °æ¿ì¿¡¸¸ µ¿ÀÛÇÑ´Ù.
¿ì¸®´Â ¸ðµç À̹ÌÁö°¡ /web/images µð·ºÅ丮 ¾È¿¡ ÀÖ´Ù°í
°¡Á¤ÇÑ´Ù.</p>
- <div class="example"><pre>
-SetEnvIf Referer "^http://www.example.com/" local_referal
+ <div class="example"><pre>SetEnvIf Referer "^http://www.example.com/" local_referal
# Referer Á¤º¸¸¦ º¸³»Áö ¾Ê´Â ºê¶ó¿ìÀú¸¦ Çã¿ëÇÑ´Ù
SetEnvIf Referer "^$" local_referal
<Directory /web/images>
önerilirdi. Fakat, böyle tarayıcılar artık ortalıkta görünmediğinden
bu yapılandırmaya da artık gerek kalmamıştır.</p>
- <div class="example"><pre>
-#
+ <div class="example"><pre>#
# Aşağıdaki yönergeler normal HTTP yanıt davranışını değiştirirler.
# İlk yönerge Netscape 2.x ve kendini öyle gösteren tarayıcılar için
# kalıcı bağlantıyı (keepalive) iptal eder. İkinci yönerge ise HTTP/1.1
directive has not been commented out. A correctly configured directive
may look like this:
- <pre class="prettyprint lang-config">
- LoadModule cgi_module modules/mod_cgi.so
- </pre>
+ <pre class="prettyprint lang-config">LoadModule cgi_module modules/mod_cgi.so</pre>
</div>
<h3><a name="scriptalias" id="scriptalias">ScriptAlias</a></h3>
´ëüÇϰí, <code>/u/user</code> ¸¶Áö¸·¿¡ ½½·¡½¬°¡ ¾ø´Ù¸é
Ãß°¡ÇÑ´Ù.</p>
-<div class="example"><pre>
-RewriteRule ^/<strong>~</strong>([^/]+)/?(.*) /<strong>u</strong>/$1/$2 [<strong>R</strong>]
-RewriteRule ^/([uge])/(<strong>[^/]+</strong>)$ /$1/$2<strong>/</strong> [<strong>R</strong>]
-</pre></div>
+<div class="example"><pre>RewriteRule ^/<strong>~</strong>([^/]+)/?(.*) /<strong>u</strong>/$1/$2 [<strong>R</strong>]
+RewriteRule ^/([uge])/(<strong>[^/]+</strong>)$ /$1/$2<strong>/</strong> [<strong>R</strong>]</pre></div>
</dd>
</dl>
<dt>ÇØ°áÃ¥:</dt>
<dd>
-<div class="example"><pre>
-RewriteCond %{HTTP_HOST} !^fully\.qualified\.domain\.name [NC]
+<div class="example"><pre>RewriteCond %{HTTP_HOST} !^fully\.qualified\.domain\.name [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{SERVER_PORT} !^80$
RewriteRule ^/(.*) http://fully.qualified.domain.name:%{SERVER_PORT}/$1 [L,R]
RewriteCond %{HTTP_HOST} !^fully\.qualified\.domain\.name [NC]
RewriteCond %{HTTP_HOST} !^$
-RewriteRule ^/(.*) http://fully.qualified.domain.name/$1 [L,R]
-</pre></div>
+RewriteRule ^/(.*) http://fully.qualified.domain.name/$1 [L,R]</pre></div>
</dd>
</dl>
ÇÒ ¼ö ¾ø´Ù. <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>¸¦ »ç¿ëÇϸé
ÁøÂ¥ °£´ÜÇÏ´Ù:</p>
-<div class="example"><pre>
-RewriteEngine on
-RewriteRule <strong>^/$</strong> /e/www/ [<strong>R</strong>]
-</pre></div>
+<div class="example"><pre>RewriteEngine on
+RewriteRule <strong>^/$</strong> /e/www/ [<strong>R</strong>]</pre></div>
</dd>
</dl>
<p>±×·¡¼ À̸¦ ÇØ°áÇϱâÀ§ÇØ ´ÙÀ½°ú °°ÀÌ ¼³Á¤ÇÑ´Ù:</p>
-<div class="example"><pre>
-RewriteEngine on
+<div class="example"><pre>RewriteEngine on
RewriteBase /~quux/
-RewriteRule ^foo<strong>$</strong> foo<strong>/</strong> [<strong>R</strong>]
-</pre></div>
+RewriteRule ^foo<strong>$</strong> foo<strong>/</strong> [<strong>R</strong>]</pre></div>
<p>Ȩµð·ºÅ丮ÀÇ ÃÖ»óÀ§ <code>.htaccess</code> ÆÄÀÏ¿¡
´ÙÀ½°ú °°ÀÌ ¼³Á¤ÇÒ ¼öµµ ÀÖ´Ù. ±×·¯³ª ó¸®Çϴµ¥ ºÎ´ãÀÌ
µÈ´Ù.</p>
-<div class="example"><pre>
-RewriteEngine on
+<div class="example"><pre>RewriteEngine on
RewriteBase /~quux/
RewriteCond %{REQUEST_FILENAME} <strong>-d</strong>
-RewriteRule ^(.+<strong>[^/]</strong>)$ $1<strong>/</strong> [R]
-</pre></div>
+RewriteRule ^(.+<strong>[^/]</strong>)$ $1<strong>/</strong> [R]</pre></div>
</dd>
</dl>
(ºÐ»êµÈ) ¿ÜºÎ¸Ê¿¡ ½ÇÁ¦ ¼¹ö Á¤º¸¸¦ ¾ò¾î¿Â´Ù. ¿ÜºÎ¸ÊÀº
´ÙÀ½°ú °°Àº Çü½ÄÀÌ´Ù</p>
-<div class="example"><pre>
-user1 server_of_user1
+<div class="example"><pre>user1 server_of_user1
user2 server_of_user2
-: :
-</pre></div>
+: :</pre></div>
<p>¿ì¸®´Â ÀÌ Á¤º¸¸¦ °¢°¢ <code>map.xxx-to-host</code>
ÆÄÀÏ¿¡ ÀúÀåÇß´Ù. ´ÙÀ½À¸·Î ¸ðµç ¼¹ö¿¡¼ URLÀÌ ¼¹ö¿¡
¾ø´Ù¸é ´ÙÀ½°ú °°Àº URLÀ»,</p>
-<div class="example"><pre>
-/u/user/anypath
+<div class="example"><pre>/u/user/anypath
/g/group/anypath
-/e/entity/anypath
-</pre></div>
+/e/entity/anypath</pre></div>
<p>´ÙÀ½°ú °°ÀÌ ¸®´ÙÀÌ·º¼ÇÇÑ´Ù</p>
-<div class="example"><pre>
-http://physical-host/u/user/anypath
+<div class="example"><pre>http://physical-host/u/user/anypath
http://physical-host/g/group/anypath
-http://physical-host/e/entity/anypath
-</pre></div>
+http://physical-host/e/entity/anypath</pre></div>
<p>¾Æ·¡ ±ÔÄ¢Àº ¸ÊÆÄÀÏÀ» »ç¿ëÇÏ¿© ÀÌ ÀÛ¾÷À» ÇÑ´Ù (server0Àº
¸Ê¿¡ Ç׸ñÀÌ ¾ø´Â °æ¿ì »ç¿ëÇÒ ±âº»¼¹ö¶ó°í °¡Á¤ÇÑ´Ù):</p>
-<div class="example"><pre>
-RewriteEngine on
+<div class="example"><pre>RewriteEngine on
RewriteMap user-to-host txt:/path/to/map.user-to-host
RewriteMap group-to-host txt:/path/to/map.group-to-host
RewriteRule ^/e/<strong>([^/]+)</strong>/?(.*) http://<strong>${entity-to-host:$1|server0}</strong>/e/$1/$2
RewriteRule ^/([uge])/([^/]+)/?$ /$1/$2/.www/
-RewriteRule ^/([uge])/([^/]+)/([^.]+.+) /$1/$2/.www/$3\
-</pre></div>
+RewriteRule ^/([uge])/([^/]+)/([^.]+.+) /$1/$2/.www/$3\</pre></div>
</dd>
</dl>
<code>http://newserver/~user/anypath</code>·Î
¸®´ÙÀÌ·º¼ÇÇÏ¸é µÈ´Ù.</p>
-<div class="example"><pre>
-RewriteEngine on
-RewriteRule ^/~(.+) http://<strong>newserver</strong>/~$1 [R,L]
-</pre></div>
+<div class="example"><pre>RewriteEngine on
+RewriteRule ^/~(.+) http://<strong>newserver</strong>/~$1 [R,L]</pre></div>
</dd>
</dl>
<p>¹°°áÇ¥½Ã°¡ ÀÖ´Â URLÀ» À§¿Í °°Àº ±¸Á¶·Î º¯È¯ÇϱâÀ§ÇØ
´ÙÀ½ ±ÔÄ¢À» »ç¿ëÇÑ´Ù.</p>
-<div class="example"><pre>
-RewriteEngine on
-RewriteRule ^/~(<strong>([a-z])</strong>[a-z0-9]+)(.*) /home/<strong>$2</strong>/$1/.www$3
-</pre></div>
+<div class="example"><pre>RewriteEngine on
+RewriteRule ^/~(<strong>([a-z])</strong>[a-z0-9]+)(.*) /home/<strong>$2</strong>/$1/.www$3</pre></div>
</dd>
</dl>
ÇØ¿Ô±â¶§¹®¿¡ ³» Ãë¹ÌÀÌÀÚ ÀÏÀÌ´Ù. ¸ÅÁÖ¸¶´Ù »õ·Î ¼ÒÇÁÆ®¿þ¾î°¡
Ãß°¡µÉ ¶§¸¶´Ù µð·ºÅ丮¸¦ ±í°Ô ¸¸µé¾î¿Ô´Ù:</p>
-<div class="example"><pre>
-drwxrwxr-x 2 netsw users 512 Aug 3 18:39 Audio/
+<div class="example"><pre>drwxrwxr-x 2 netsw users 512 Aug 3 18:39 Audio/
drwxrwxr-x 2 netsw users 512 Jul 9 14:37 Benchmark/
drwxrwxr-x 12 netsw users 512 Jul 9 00:34 Crypto/
drwxrwxr-x 5 netsw users 512 Jul 9 00:41 Database/
drwxrwxr-x 7 netsw users 512 Jul 9 09:24 SoftEng/
drwxrwxr-x 7 netsw users 512 Jul 9 12:17 System/
drwxrwxr-x 12 netsw users 512 Aug 3 20:15 Typesetting/
-drwxrwxr-x 10 netsw users 512 Jul 9 14:08 X11/
-</pre></div>
+drwxrwxr-x 10 netsw users 512 Jul 9 14:08 X11/</pre></div>
<p>1996³â 7¿ù ÀÌ ÀúÀå¼Ò¸¦ ¸ÚÀÖ´Â À¥ ÀÎÅÍÆäÀ̽º¸¦ ÅëÇØ
¼¼»ó¿¡ °ø°³Çϱâ·Î °áÁ¤ÇÞ´Ù. "¸ÚÀÖ´Ù"´Â ¸»Àº, ÃÖ»óÀ§
ÇÊ¿äÇÏ´Ù. ³ª´Â ÀÌ ½ºÅ©¸³Æ®µéÀ» ´ÙÀ½°ú °°ÀÌ
<code>/e/netsw/.www/</code>¿¡ µÎ¾ú´Ù:</p>
-<div class="example"><pre>
--rw-r--r-- 1 netsw users 1318 Aug 1 18:10 .wwwacl
+<div class="example"><pre>-rw-r--r-- 1 netsw users 1318 Aug 1 18:10 .wwwacl
drwxr-xr-x 18 netsw users 512 Aug 5 15:51 DATA/
-rw-rw-rw- 1 netsw users 372982 Aug 5 16:35 LOGFILE
-rw-r--r-- 1 netsw users 659 Aug 4 09:27 TODO
-rwxr-xr-x 1 netsw users 24050 Aug 5 15:49 netsw-lsdir.cgi
-rwxr-xr-x 1 netsw users 1589 Aug 3 18:43 netsw-search.cgi
-rwxr-xr-x 1 netsw users 1885 Aug 1 17:41 netsw-tree.cgi
--rw-r--r-- 1 netsw users 234 Jul 30 16:35 netsw-unlimit.lst
-</pre></div>
+-rw-r--r-- 1 netsw users 234 Jul 30 16:35 netsw-unlimit.lst</pre></div>
<p><code>DATA/</code> ÇÏÀ§µð·ºÅ丮¿¡ À§¿¡¼ ¸»ÇÑ ÀúÀå¼Ò°¡
ÀÖ´Ù. ½ÇÁ¦ <strong><em>net.sw</em></strong>ÀÇ ³»¿ëÀº º¸Åë
URL <code>/net.sw/</code>¸¦ ³»ºÎ °æ·Î <code>/e/netsw</code>·Î
ÀçÀÛ¼ºÇϱâÀ§ÇØ µð·ºÅ丮º° ¼³Á¤ÆÄÀÏ¿¡ ´ÙÀ½°ú °°ÀÌ ¼³Á¤ÇÑ´Ù:</p>
-<div class="example"><pre>
-RewriteRule ^net.sw$ net.sw/ [R]
-RewriteRule ^net.sw/(.*)$ e/netsw/$1
-</pre></div>
+<div class="example"><pre>RewriteRule ^net.sw$ net.sw/ [R]
+RewriteRule ^net.sw/(.*)$ e/netsw/$1</pre></div>
<p>ù¹øÂ° ±ÔÄ¢Àº ¸¶Áö¸·¿¡ ½½·¡½¬°¡ ¾ø´Â ¿äûÀ» À§Çؼ
»ç¿ëÇß´Ù! µÎ¹øÂ° ±ÔÄ¢ÀÌ ½ÇÁ¦ ÀÛ¾÷À» ÇÑ´Ù. ±×¸®°í µð·ºÅ丮º°
¼³Á¤ÆÄÀÏ <code>/e/netsw/.www/.wwwacl</code>¿¡ °áÁ¤ÀûÀÎ
¼³Á¤ÀÌ ³ª¿Â´Ù:</p>
-<div class="example"><pre>
-Options ExecCGI FollowSymLinks Includes MultiViews
+<div class="example"><pre>Options ExecCGI FollowSymLinks Includes MultiViews
RewriteEngine on
# ´Ù¸¥ cgi ½ºÅ©¸³Æ®°¡ ó¸®ÇÒ
# ÇÏÀ§µð·ºÅ丮°¡ ³²¾Ò´Ù
RewriteRule !^netsw-lsdir\.cgi.* - [C]
-RewriteRule (.*) netsw-lsdir.cgi/$1
-</pre></div>
+RewriteRule (.*) netsw-lsdir.cgi/$1</pre></div>
<p>ÇØ¼®À» À§ÇÑ ÈùÆ®:</p>
<p>¸ðµç ¿äû¿¡¼ ¾ÕºÎºÐÀ» µ¿ÀûÀ¸·Î Á¦°ÅÇÏ´Â Àü¿ª ±ÔÄ¢À»
»ç¿ëÇÑ´Ù:</p>
-<div class="example"><pre>
-RewriteEngine on
-RewriteRule ^/cgi-bin/imagemap(.*) $1 [PT]
-</pre></div>
+<div class="example"><pre>RewriteEngine on
+RewriteRule ^/cgi-bin/imagemap(.*) $1 [PT]</pre></div>
</dd>
</dl>
<dd>
<p>¿©·¯ µð·ºÅ丮¿¡¼ ÆÄÀÏÀ» ã´Â ±ÔÄ¢À» Á÷Á¢ ÇÁ·Î±×·¥ÇÑ´Ù.</p>
-<div class="example"><pre>
-RewriteEngine on
+<div class="example"><pre>RewriteEngine on
# ¸ÕÀú custom/¿¡¼ ã±æ ½ÃµµÇϰí...
# ...ãÀ¸¸é ³¡!
RewriteRule ^(.+) /your/docroot/<strong>dir2</strong>/$1 [L]
# ¸øÃ£À¸¸é ´Ù¸¥ Alias³ª ScriptAlias Áö½Ã¾î µîÀ¸·Î ÁøÇàÇÑ´Ù.
-RewriteRule ^(.+) - [PT]
-</pre></div>
+RewriteRule ^(.+) - [PT]</pre></div>
</dd>
</dl>
<code>/foo/bar/</code>·Î º¯È¯µÇ°í <code>STATUS</code>¶ó´Â
ȯ°æº¯¼ö °ªÀ» "java"·Î ¼³Á¤ÇÑ´Ù.</p>
-<div class="example"><pre>
-RewriteEngine on
-RewriteRule ^(.*)/<strong>S=([^/]+)</strong>/(.*) $1/$3 [E=<strong>STATUS:$2</strong>]
-</pre></div>
+<div class="example"><pre>RewriteEngine on
+RewriteRule ^(.*)/<strong>S=([^/]+)</strong>/(.*) $1/$3 [E=<strong>STATUS:$2</strong>]</pre></div>
</dd>
</dl>
<code>/home/username/anypath</code>·Î ÀçÀÛ¼ºÇÒ ¼ö
ÀÖ´Ù:</p>
-<div class="example"><pre>
-RewriteEngine on
+<div class="example"><pre>RewriteEngine on
RewriteCond %{<strong>HTTP_HOST</strong>} ^www\.<strong>[^.]+</strong>\.host\.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
-RewriteRule ^www\.<strong>([^.]+)</strong>\.host\.com(.*) /home/<strong>$1</strong>$2
-</pre></div>
+RewriteRule ^www\.<strong>([^.]+)</strong>\.host\.com(.*) /home/<strong>$1</strong>$2</pre></div>
</dd>
</dl>
<dd>
<p>ÀçÀÛ¼º Á¶°ÇÀ» »ç¿ëÇÏ¸é µÈ´Ù:</p>
-<div class="example"><pre>
-RewriteEngine on
+<div class="example"><pre>RewriteEngine on
RewriteCond %{REMOTE_HOST} <strong>!^.+\.ourdomain\.com$</strong>
-RewriteRule ^(/~.+) http://www.somewhere.com/$1 [R,L]
-</pre></div>
+RewriteRule ^(/~.+) http://www.somewhere.com/$1 [R,L]</pre></div>
</dd>
</dl>
<p>ù¹øÂ° ¹æ¹ýÀº ºü¸£Áö¸¸ À¯¿¬¼ºÀÌ ¶³¾îÁö°í ¿ÏÀüÇÏÁö
¾Ê´Ù:</p>
-<div class="example"><pre>
-RewriteEngine on
+<div class="example"><pre>RewriteEngine on
RewriteCond /your/docroot/%{REQUEST_FILENAME} <strong>!-f</strong>
-RewriteRule ^(.+) http://<strong>webserverB</strong>.dom/$1
-</pre></div>
+RewriteRule ^(.+) http://<strong>webserverB</strong>.dom/$1</pre></div>
<p>ÀÌ ¹æ¹ýÀÇ ´ÜÁ¡Àº <code class="directive"><a href="../mod/core.html#documentroot">DocumentRoot</a></code> ¾È¿¡ ÀÖ´Â ÆäÀÌÁö¸¸
°¡´ÉÇÏ´Ù´Â Á¡ÀÌ´Ù. (¿¹¸¦ µé¾î Ȩµð·ºÅ丮 µîÀ» À§ÇØ)
Á¶°ÇÀ» Ãß°¡ÇÒ ¼ö ÀÖÁö¸¸, ´õ ÁÁÀº ¹æ¹ýÀÌ ÀÖ´Ù:</p>
-<div class="example"><pre>
-RewriteEngine on
+<div class="example"><pre>RewriteEngine on
RewriteCond %{REQUEST_URI} <strong>!-U</strong>
-RewriteRule ^(.+) http://<strong>webserverB</strong>.dom/$1
-</pre></div>
+RewriteRule ^(.+) http://<strong>webserverB</strong>.dom/$1</pre></div>
<p><code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>ÀÇ URL Àü¹æÂüÁ¶(look-ahead)¸¦
»ç¿ëÇÑ´Ù. ±×·¡¼ ¸ðµç URL¿¡ µ¿ÀÛÇÏ°í ¾ÈÀüÇÏ´Ù. ±×·¯³ª
³¡ºÎºÐ¿¡ »ç¿ëÇØ¾ß ÇÑ´Ù) »õ·Î¿î URL scheme
<code>xredirect:</code>¸¦ µµÀÔÇÑ´Ù:</p>
-<div class="example"><pre>
-RewriteRule ^xredirect:(.+) /path/to/nph-xredirect.cgi/$1 \
- [T=application/x-httpd-cgi,L]
-</pre></div>
+<div class="example"><pre>RewriteRule ^xredirect:(.+) /path/to/nph-xredirect.cgi/$1 \
+ [T=application/x-httpd-cgi,L]</pre></div>
<p>±×·¯¸é <code>xredirect:</code>·Î ½ÃÀÛÇÏ´Â ¸ðµç URLÀº
<code>nph-xredirect.cgi</code> ÇÁ·Î±×·¥À» ÅëÇÏ°Ô µÈ´Ù.
ÇÁ·Î±×·¥Àº ´ÙÀ½°ú °°´Ù:</p>
-<div class="example"><pre>
-#!/path/to/perl
+<div class="example"><pre>#!/path/to/perl
##
## nph-xredirect.cgi -- NPH/CGI script for extended redirects
## Copyright (c) 1997 Ralf S. Engelschall, All Rights Reserved.
print "</body>\n";
print "</html>\n";
-##EOF##
-</pre></div>
+##EOF##</pre></div>
<p>±×·¯¸é <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>°¡ Á÷Á¢ ¹ÞÁö¸øÇÏ´Â
¸ðµç URL schemeÀ¸·Î ¸®´ÙÀÌ·º¼ÇÇÒ ¼ö ÀÖ´Ù. ¿¹¸¦ µé¾î,
´ÙÀ½°ú °°ÀÌ <code>news:newsgroup</code>À¸·Î ¸®´ÙÀÌ·º¼ÇÇÒ
¼ö ÀÖ´Ù</p>
-<div class="example"><pre>
-RewriteRule ^anyurl xredirect:news:newsgroup
-</pre></div>
+<div class="example"><pre>RewriteRule ^anyurl xredirect:news:newsgroup</pre></div>
<div class="note">ÁÖÀÇ: À§ÀÇ Æ¯º°ÇÑ "Åë°ú" ±ÔÄ¢À» »ç¿ëÇÏ¿©
<code>xredirect:</code>¸¦ ¸¶Áö¸·¿¡ È®ÀåÇØ¾ß Çϱ⶧¹®¿¡
»ç¿ëÇÏ¿© À§Ä¡¸¦ ÃßÁ¤ÇÒ ¼ö ÀÖ´Ù. º¹ÀâÈ÷ ¿«ÀÎ ±ÔÄ¢¿¡¼
ÃÖ»óÀ§ µµ¸ÞÀÎÀ» Áß°è¸ÊÀÇ Å°·Î »ç¿ëÇÑ´Ù.</p>
-<div class="example"><pre>
-RewriteEngine on
+<div class="example"><pre>RewriteEngine on
RewriteMap multiplex txt:/path/to/map.cxan
RewriteRule ^/CxAN/(.*) %{REMOTE_HOST}::$1 [C]
-RewriteRule ^.+\.<strong>([a-zA-Z]+)</strong>::(.*)$ ${multiplex:<strong>$1</strong>|ftp.default.dom}$2 [R,L]
-</pre></div>
+RewriteRule ^.+\.<strong>([a-zA-Z]+)</strong>::(.*)$ ${multiplex:<strong>$1</strong>|ftp.default.dom}$2 [R,L]</pre></div>
-<div class="example"><pre>
-##
+<div class="example"><pre>##
## map.cxan -- Multiplexing Map for CxAN
##
uk ftp://ftp.cxan.uk/CxAN/
com ftp://ftp.cxan.com/CxAN/
:
-##EOF##
-</pre></div>
+##EOF##</pre></div>
</dd>
</dl>
<code>=STRING</code>À» »ç¿ëÇÏ¿© ½Ã°£¿¡ µû¶ó ¸®´ÙÀÌ·º¼ÇÇÒ
¼ö ÀÖ´Ù:</p>
-<div class="example"><pre>
-RewriteEngine on
+<div class="example"><pre>RewriteEngine on
RewriteCond %{TIME_HOUR}%{TIME_MIN} >0700
RewriteCond %{TIME_HOUR}%{TIME_MIN} <1900
RewriteRule ^foo\.html$ foo.day.html
-RewriteRule ^foo\.html$ foo.night.html
-</pre></div>
+RewriteRule ^foo\.html$ foo.night.html</pre></div>
<p>URL <code>foo.html</code>À» ¿äûÇϸé
<code>07:00-19:00</code> µ¿¾È <code>foo.day.html</code>
¾øÀ¸¸é URLÀ» ¿ø·¡ »óÅ·ΠÀçÀÛ¼ºÇÑ´Ù.</p>
-<div class="example"><pre>
-# ¹®¼.html ÀÌ ¾ø°í
+<div class="example"><pre># ¹®¼.html ÀÌ ¾ø°í
# ¹®¼.phtml ¸¸ ÀÖ´Â °æ¿ì
# ¹®¼.html À» ¹®¼.phtml ·Î
# ÀçÀÛ¼ºÇÏ´Â ¿ªÈ£È¯ ±ÔÄ¢
RewriteRule ^(.*)$ $1.phtml [S=1]
# ¾Æ´Ï¸é ¾Õ¿¡¼ ãÀº ±âº»À̸§À» µÇµ¹¸°´Ù
RewriteCond %{ENV:WasHTML} ^yes$
-RewriteRule ^(.*)$ $1.html
-</pre></div>
+RewriteRule ^(.*)$ $1.html</pre></div>
</dd>
</dl>
<p>´ÙÀ½ ±ÔÄ¢À¸·Î ÀÌÀü URLÀ» ³»ºÎÀûÀ¸·Î »õ·Î¿î URL·Î
ÀçÀÛ¼ºÇÑ´Ù:</p>
-<div class="example"><pre>
-RewriteEngine on
+<div class="example"><pre>RewriteEngine on
RewriteBase /~quux/
-RewriteRule ^<strong>foo</strong>\.html$ <strong>bar</strong>.html
-</pre></div>
+RewriteRule ^<strong>foo</strong>\.html$ <strong>bar</strong>.html</pre></div>
</dd>
</dl>
<p>»õ·Î¿î URL·Î HTTP ¸®´ÙÀÌ·º¼ÇÇÏ´Ù. ±×·¯¸é ºê¶ó¿ìÀú°¡
»õ·Î¿î URL¸¦ º¸ÀÌ°í º¯°æ»ç½ÇÀ» »ç¿ëÀÚ°¡ ¾Ë°ÔµÈ´Ù:</p>
-<div class="example"><pre>
-RewriteEngine on
+<div class="example"><pre>RewriteEngine on
RewriteBase /~quux/
-RewriteRule ^<strong>foo</strong>\.html$ <strong>bar</strong>.html [<strong>R</strong>]
-</pre></div>
+RewriteRule ^<strong>foo</strong>\.html$ <strong>bar</strong>.html [<strong>R</strong>]</pre></div>
</dd>
</dl>
<code>foo.32.html</code> ÆäÀÌÁö¸¦ ¹Þ´Â´Ù. ¾Æ·¡ ±ÔÄ¢ÀÌ
ÀÌ ÀÛ¾÷À» ÇÑ´Ù:</p>
-<div class="example"><pre>
-RewriteCond %{HTTP_USER_AGENT} ^<strong>Mozilla/3</strong>.*
+<div class="example"><pre>RewriteCond %{HTTP_USER_AGENT} ^<strong>Mozilla/3</strong>.*
RewriteRule ^foo\.html$ foo.<strong>NS</strong>.html [<strong>L</strong>]
RewriteCond %{HTTP_USER_AGENT} ^<strong>Lynx/</strong>.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^<strong>Mozilla/[12]</strong>.*
RewriteRule ^foo\.html$ foo.<strong>20</strong>.html [<strong>L</strong>]
-RewriteRule ^foo\.html$ foo.<strong>32</strong>.html [<strong>L</strong>]
-</pre></div>
+RewriteRule ^foo\.html$ foo.<strong>32</strong>.html [<strong>L</strong>]</pre></div>
</dd>
</dl>
<code>[P]</code>) »ç¿ëÇÏ¿© ¿ÜºÎ À¥ÆäÀÌÁö ȤÀº ¿ÜºÎ
À¥°ø°£ Àüü¸¦ ¿ì¸® À̸§°ø°£À¸·Î ´ëÀÀÇÑ´Ù:</p>
-<div class="example"><pre>
-RewriteEngine on
+<div class="example"><pre>RewriteEngine on
RewriteBase /~quux/
-RewriteRule ^<strong>hotsheet/</strong>(.*)$ <strong>http://www.tstimpreso.com/hotsheet/</strong>$1 [<strong>P</strong>]
-</pre></div>
+RewriteRule ^<strong>hotsheet/</strong>(.*)$ <strong>http://www.tstimpreso.com/hotsheet/</strong>$1 [<strong>P</strong>]</pre></div>
-<div class="example"><pre>
-RewriteEngine on
+<div class="example"><pre>RewriteEngine on
RewriteBase /~quux/
-RewriteRule ^<strong>usa-news\.html</strong>$ <strong>http://www.quux-corp.com/news/index.html</strong> [<strong>P</strong>]
-</pre></div>
+RewriteRule ^<strong>usa-news\.html</strong>$ <strong>http://www.quux-corp.com/news/index.html</strong> [<strong>P</strong>]</pre></div>
</dd>
</dl>
<dt>ÇØ°áÃ¥:</dt>
<dd>
-<div class="example"><pre>
-RewriteEngine on
+<div class="example"><pre>RewriteEngine on
RewriteCond /mirror/of/remotesite/$1 -U
-RewriteRule ^http://www\.remotesite\.com/(.*)$ /mirror/of/remotesite/$1
-</pre></div>
+RewriteRule ^http://www\.remotesite\.com/(.*)$ /mirror/of/remotesite/$1</pre></div>
</dd>
</dl>
proxy throughput ±â´ÉÀ» ÅëÇØ ¿äûÇÏ´Â
<code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> ±ÔÄ¢À» ÀÛ¼ºÇÑ´Ù:</p>
-<div class="example"><pre>
-RewriteRule ^/~([^/]+)/?(.*) /home/$1/.www/$2
+<div class="example"><pre>RewriteRule ^/~([^/]+)/?(.*) /home/$1/.www/$2
RewriteCond %{REQUEST_FILENAME} <strong>!-f</strong>
RewriteCond %{REQUEST_FILENAME} <strong>!-d</strong>
-RewriteRule ^/home/([^/]+)/.www/?(.*) http://<strong>www2</strong>.quux-corp.dom/~$1/pub/$2 [<strong>P</strong>]
-</pre></div>
+RewriteRule ^/home/([^/]+)/.www/?(.*) http://<strong>www2</strong>.quux-corp.dom/~$1/pub/$2 [<strong>P</strong>]</pre></div>
</dd>
</dl>
°°ÀÌ DNS A(address) ·¹Äڵ忡
<code>www[0-9].foo.com</code>À» ¼³Á¤ÇÑ´Ù.</p>
-<div class="example"><pre>
-www0 IN A 1.2.3.1
+<div class="example"><pre>www0 IN A 1.2.3.1
www1 IN A 1.2.3.2
www2 IN A 1.2.3.3
www3 IN A 1.2.3.4
www4 IN A 1.2.3.5
-www5 IN A 1.2.3.6
-</pre></div>
+www5 IN A 1.2.3.6</pre></div>
<p>±×¸®°í ´ÙÀ½ Ç׸ñÀ» Ãß°¡ÇÑ´Ù:</p>
-<div class="example"><pre>
-www IN CNAME www0.foo.com.
+<div class="example"><pre>www IN CNAME www0.foo.com.
IN CNAME www1.foo.com.
IN CNAME www2.foo.com.
IN CNAME www3.foo.com.
IN CNAME www4.foo.com.
IN CNAME www5.foo.com.
- IN CNAME www6.foo.com.
-</pre></div>
+ IN CNAME www6.foo.com.</pre></div>
<p>À߸øµÈ °Íó·³ º¸ÀÌÁö¸¸, ½ÇÁ¦·Î <code>BIND</code>ÀÇ
ÀǵµµÈ ±â´ÉÀÌ´Ù. ÀÌÁ¦ <code>www.foo.com</code>À»
»ç¿ëÇÏ¿© <code>www0.foo.com</code>ÀÌ ½ÇÁ¦
<code>www.foo.com</code>À» Àü´ãÇÏ°Ô ÇÑ´Ù</p>
-<div class="example"><pre>
-www IN CNAME www0.foo.com.
-</pre></div>
+<div class="example"><pre>www IN CNAME www0.foo.com.</pre></div>
<p>±×¸®°í <code>www0.foo.com</code>À» ÇÁ·Ï½ÃÀü¿ë
¼¹ö·Î º¯°æÇÑ´Ù. Áï, URLÀ» ¹ÞÀ¸¸é ¼¹ö´Â ³»ºÎ
·Îµå¹ë·±½Ì ½ºÅ©¸³Æ® <code>lb.pl</code>·Î º¸³»´Â
±ÔÄ¢À» ¸¸µç´Ù.</p>
-<div class="example"><pre>
-RewriteEngine on
+<div class="example"><pre>RewriteEngine on
RewriteMap lb prg:/path/to/lb.pl
-RewriteRule ^/(.+)$ ${lb:$1} [P,L]
-</pre></div>
+RewriteRule ^/(.+)$ ${lb:$1} [P,L]</pre></div>
<p><code>lb.pl</code>À» ÀÛ¼ºÇÑ´Ù:</p>
-<div class="example"><pre>
-#!/path/to/perl
+<div class="example"><pre>#!/path/to/perl
##
## lb.pl -- ·Îµå¹ë·±½Ì ½ºÅ©¸³Æ®
##
print "http://$server/$_";
}
-##EOF##
-</pre></div>
+##EOF##</pre></div>
<div class="note">¸¶Áö¸· ÁÖÀÇ: ¿Ö ÀÌ ¹æ¹ýÀÌ À¯¿ëÇѰ¡?
<code>www0.foo.com</code>¿¡ ºÎ´ãÀÌ °¡Áö¾Ê´Â°¡?
<code>/~user/foo/bar.scgi/</code> Çü½ÄÀÇ URLÀ»
¿øÇϱ⶧¹®ÀÌ´Ù. ´ÙÀ½ ±ÔÄ¢ÀÌ ¹®Á¦¸¦ ÇØ°áÇÑ´Ù:</p>
-<div class="example"><pre>
-RewriteRule ^/[uge]/<strong>([^/]+)</strong>/\.www/(.+)\.scgi(.*) ...
-... /internal/cgi/user/cgiwrap/~<strong>$1</strong>/$2.scgi$3 [NS,<strong>T=application/x-http-cgi</strong>]
-</pre></div>
+<div class="example"><pre>RewriteRule ^/[uge]/<strong>([^/]+)</strong>/\.www/(.+)\.scgi(.*) ...
+... /internal/cgi/user/cgiwrap/~<strong>$1</strong>/$2.scgi$3 [NS,<strong>T=application/x-http-cgi</strong>]</pre></div>
<p>ÀÌÁ¦ ´Ù¸¥ ¸ÚÁø ÇÁ·Î±×·¥, (URL ÇÏÀ§Æ®¸®¿¡ ´ëÇÑ
<code>access.log</code>¸¦ Ãâ·ÂÇÏ´Â) <code>wwwlog</code>¿Í
<code>/u/user/foo/</code>¿¡ ´ëÇØ <code>swwidx</code>
ÇÁ·Î±×·¥À» ½ÇÇàÇÑ´Ù¸é ´ÙÀ½°ú °°Àº ¸µÅ©¸¦ »ç¿ëÇÑ´Ù</p>
-<div class="example"><pre>
-/internal/cgi/user/swwidx?i=/u/user/foo/
-</pre></div>
+<div class="example"><pre>/internal/cgi/user/swwidx?i=/u/user/foo/</pre></div>
<p>±ò²ûÇÏÁö ¾Ê´Ù. ¸µÅ©¿¡ ¿µ¿ªÀÇ À§Ä¡<strong>¿Í</strong>
CGI À§Ä¡¸¦ <strong>¸ðµÎ</strong> Àû¾î¾ß Çϱ⶧¹®ÀÌ´Ù.
<p>ÇØ°áÃ¥Àº ÀÚµ¿À¸·Î ÀûÀýÇÑ CGI¸¦ ½ÇÇàÇÏ´Â »õ·Î¿î
Ưº°ÇÑ URL Çü½ÄÀ» ¸¸µå´Â °ÍÀÌ´Ù. ´ÙÀ½°ú °°ÀÌ ¼³Á¤ÇÑ´Ù:</p>
-<div class="example"><pre>
-RewriteRule ^/([uge])/([^/]+)(/?.*)/\* /internal/cgi/user/wwwidx?i=/$1/$2$3/
-RewriteRule ^/([uge])/([^/]+)(/?.*):log /internal/cgi/user/wwwlog?f=/$1/$2$3
-</pre></div>
+<div class="example"><pre>RewriteRule ^/([uge])/([^/]+)(/?.*)/\* /internal/cgi/user/wwwidx?i=/$1/$2$3/
+RewriteRule ^/([uge])/([^/]+)(/?.*):log /internal/cgi/user/wwwlog?f=/$1/$2$3</pre></div>
<p>ÀÌÁ¦ <code>/u/user/foo/</code>À» °Ë»öÇÏ´Â ¸µÅ©´Â
´ÙÀ½°ú °°´Ù</p>
-<div class="example"><pre>
-HREF="*"
-/u/user/foo/* (???)
-</pre></div>
+<div class="example"><pre>HREF="*"
+/u/user/foo/* (???)</pre></div>
<p>³»ºÎÀûÀ¸·Î ´ÙÀ½°ú °°ÀÌ ÀÚµ¿º¯È¯µÈ´Ù</p>
-<div class="example"><pre>
-/internal/cgi/user/wwwidx?i=/u/user/foo/
-</pre></div>
+<div class="example"><pre>/internal/cgi/user/wwwidx?i=/u/user/foo/</pre></div>
<p>°°Àº ¹æ¹ýÀ¸·Î ¸µÅ© µÚ¿¡ <code>:log</code>¸¦ »ç¿ëÇÏ¿©
Á¢±Ù ·Î±× CGI ÇÁ·Î±×·¥À» ½ÇÇàÇÒ ¼ö ÀÖ´Ù.</p>
<code>/~quux/foo.html</code>¸¦ ¿äûÇÏ¸é ³»ºÎÀûÀ¸·Î
<code>/~quux/foo.cgi</code>¸¦ ½ÇÇàÇÏ°Ô µÈ´Ù.</p>
-<div class="example"><pre>
-RewriteEngine on
+<div class="example"><pre>RewriteEngine on
RewriteBase /~quux/
-RewriteRule ^foo\.<strong>html</strong>$ foo.<strong>cgi</strong> [T=<strong>application/x-httpd-cgi</strong>]
-</pre></div>
+RewriteRule ^foo\.<strong>html</strong>$ foo.<strong>cgi</strong> [T=<strong>application/x-httpd-cgi</strong>]</pre></div>
</dd>
</dl>
<dd>
´ÙÀ½ ±ÔÄ¢À» »ç¿ëÇÑ´Ù:
-<div class="example"><pre>
-RewriteCond %{REQUEST_FILENAME} <strong>!-s</strong>
-RewriteRule ^page\.<strong>html</strong>$ page.<strong>cgi</strong> [T=application/x-httpd-cgi,L]
-</pre></div>
+<div class="example"><pre>RewriteCond %{REQUEST_FILENAME} <strong>!-s</strong>
+RewriteRule ^page\.<strong>html</strong>$ page.<strong>cgi</strong> [T=application/x-httpd-cgi,L]</pre></div>
<p>¿©±â¼ <code>page.html</code>¸¦ ¿äûÇÒ¶§
<code>page.html</code>ÀÌ ¾ø°Å³ª ÆÄÀÏÅ©±â°¡ 0ÀÎ °æ¿ì
<code>:refresh</code>¸¦ Ãß°¡Çϱ⸸ ÇÏ¸é ÆÄÀϽýºÅÛ¿¡¼
¼öÁ¤µÉ ¶§¸¶´Ù »õ·Î °íħÇÑ´Ù.</p>
-<div class="example"><pre>
-RewriteRule ^(/[uge]/[^/]+/?.*):refresh /internal/cgi/apache/nph-refresh?f=$1
-</pre></div>
+<div class="example"><pre>RewriteRule ^(/[uge]/[^/]+/?.*):refresh /internal/cgi/apache/nph-refresh?f=$1</pre></div>
<p>ÀÌÁ¦ ´ÙÀ½ URL¿¡ Á¢±ÙÇϸé</p>
-<div class="example"><pre>
-/u/foo/bar/page.html:refresh
-</pre></div>
+<div class="example"><pre>/u/foo/bar/page.html:refresh</pre></div>
<p>´ÙÀ½ URLÀ» ³»ºÎÀûÀ¸·Î ºÎ¸¥´Ù</p>
-<div class="example"><pre>
-/internal/cgi/apache/nph-refresh?f=/u/foo/bar/page.html
-</pre></div>
+<div class="example"><pre>/internal/cgi/apache/nph-refresh?f=/u/foo/bar/page.html</pre></div>
<p>ÀÌÁ¦ NPH-CGI ½ºÅ©¸³Æ®¸¸ ³²¾Ò´Ù. º¸Åë "µ¶ÀÚ¿¡°Ô
¿¬½ÀÀ¸·Î ³²°ÜµÒ"À̶ó°í ¸»ÇÏÁö¸¸ ;-) ³ª´Â À̰͵µ Á¦°øÇÑ´Ù.</p>
-<div class="example"><pre>
-#!/sw/bin/perl
+<div class="example"><pre>#!/sw/bin/perl
##
## nph-refresh -- NPH/CGI script for auto refreshing pages
## Copyright (c) 1997 Ralf S. Engelschall, All Rights Reserved.
exit(0);
-##EOF##
-</pre></div>
+##EOF##</pre></div>
</dd>
</dl>
±â´ÉÀ» (Ç÷¡±× <code>[P]</code>) »ç¿ëÇÏ¿© ¿ÜºÎ À¥ÆäÀÌÁö
ȤÀº Àüü ¿ÜºÎ À¥¿µ¿ªÀ» ¿ì¸®ÀÇ À̸§°ø°£¿¡ ´ëÀÀÇÑ´Ù:</p>
-<div class="example"><pre>
-##
+<div class="example"><pre>##
## vhost.map
##
www.vhost1.dom:80 /path/to/docroot/vhost1
www.vhost2.dom:80 /path/to/docroot/vhost2
:
-www.vhostN.dom:80 /path/to/docroot/vhostN
-</pre></div>
+www.vhostN.dom:80 /path/to/docroot/vhostN</pre></div>
-<div class="example"><pre>
-##
+<div class="example"><pre>##
## httpd.conf
##
:
# 5. ¸¶Áö¸·À¸·Î URLÀ» ¹®¼ À§Ä¡·Î ´ëÀÀÇϰí
# ·Î±×¿¡ ³²±â±âÀ§ÇØ °¡»óÈ£½ºÆ®¸¦ ±â¾ïÇØ µÐ´Ù
RewriteRule ^/(.*)$ %1/$1 [E=VHOST:${lowercase:%{HTTP_HOST}}]
- :
-</pre></div>
+ :</pre></div>
</dd>
</dl>
¸·´Â °ÍÀ¸·Î´Â ºÒÃæºÐÇϸç, ±× È£½ºÆ®ÀÇ »ç¿ëÀÚµµ ¸·¾Æ¹ö¸®°Ô
µÈ´Ù. User-Agent HTTP Çì´õ Á¤º¸µµ ºñ±³ÇÑ´Ù.</p>
-<div class="example"><pre>
-RewriteCond %{HTTP_USER_AGENT} ^<strong>NameOfBadRobot</strong>.*
+<div class="example"><pre>RewriteCond %{HTTP_USER_AGENT} ^<strong>NameOfBadRobot</strong>.*
RewriteCond %{REMOTE_ADDR} ^<strong>123\.45\.67\.[8-9]</strong>$
-RewriteRule ^<strong>/~quux/foo/arc/</strong>.+ - [<strong>F</strong>]
-</pre></div>
+RewriteRule ^<strong>/~quux/foo/arc/</strong>.+ - [<strong>F</strong>]</pre></div>
</dd>
</dl>
<p>±×¸²À» 100% º¸È£ÇÒ ¼ö´Â ¾øÁö¸¸, ÃÖ¼ÒÇÑ ºê¶ó¿ìÀú°¡
HTTP Referer Çì´õ¸¦ º¸³»´Â °æ¿ì Á¦ÇÑÇÒ ¼ö ÀÖ´Ù.</p>
-<div class="example"><pre>
-RewriteCond %{HTTP_REFERER} <strong>!^$</strong>
+<div class="example"><pre>RewriteCond %{HTTP_REFERER} <strong>!^$</strong>
RewriteCond %{HTTP_REFERER} !^http://www.quux-corp.de/~quux/.*$ [NC]
-RewriteRule <strong>.*\.gif$</strong> - [F]
-</pre></div>
+RewriteRule <strong>.*\.gif$</strong> - [F]</pre></div>
-<div class="example"><pre>
-RewriteCond %{HTTP_REFERER} !^$
+<div class="example"><pre>RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !.*/foo-with-gif\.html$
-RewriteRule <strong>^inlined-in-foo\.gif$</strong> - [F]
-</pre></div>
+RewriteRule <strong>^inlined-in-foo\.gif$</strong> - [F]</pre></div>
</dd>
</dl>
<dd>
<p>¾ÆÆÄÄ¡ >= 1.3b6¿¡¼:</p>
-<div class="example"><pre>
-RewriteEngine on
+<div class="example"><pre>RewriteEngine on
RewriteMap hosts-deny txt:/path/to/hosts.deny
RewriteCond ${hosts-deny:%{REMOTE_HOST}|NOT-FOUND} !=NOT-FOUND [OR]
RewriteCond ${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND} !=NOT-FOUND
-RewriteRule ^/.* - [F]
-</pre></div>
+RewriteRule ^/.* - [F]</pre></div>
<p>¾ÆÆÄÄ¡ <= 1.3b6¿¡¼:</p>
-<div class="example"><pre>
-RewriteEngine on
+<div class="example"><pre>RewriteEngine on
RewriteMap hosts-deny txt:/path/to/hosts.deny
RewriteRule ^/(.*)$ ${hosts-deny:%{REMOTE_HOST}|NOT-FOUND}/$1
RewriteRule !^NOT-FOUND/.* - [F]
RewriteRule ^NOT-FOUND/(.*)$ ${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND}/$1
RewriteRule !^NOT-FOUND/.* - [F]
-RewriteRule ^NOT-FOUND/(.*)$ /$1
-</pre></div>
+RewriteRule ^NOT-FOUND/(.*)$ /$1</pre></div>
-<div class="example"><pre>
-##
+<div class="example"><pre>##
## hosts.deny
##
## ÁÖÀÇ! À̰ÍÀº ¸ñ·Ïó·³ º¸ÀÌÁö¸¸ ¸ñ·ÏÀÌ ¾Æ´Ï¶ó ¸ÊÀÌ´Ù.
193.102.180.41 -
bsdti1.sdm.de -
-192.76.162.40 -
-</pre></div>
+192.76.162.40 -</pre></div>
</dd>
</dl>
<code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> <em>ÀÌÀü¿¡</em> ºÒ¸°´Ù.
ÀÌÁ¦ ´ÙÀ½°ú °°ÀÌ Æ¯Á¤ È£½ºÆ®¸¦ °ÅºÎÇϵµ·Ï ¼³Á¤ÇÑ´Ù...</p>
-<div class="example"><pre>
-RewriteCond %{REMOTE_HOST} <strong>^badhost\.mydomain\.com$</strong>
-RewriteRule !^http://[^/.]\.mydomain.com.* - [F]
-</pre></div>
+<div class="example"><pre>RewriteCond %{REMOTE_HOST} <strong>^badhost\.mydomain\.com$</strong>
+RewriteRule !^http://[^/.]\.mydomain.com.* - [F]</pre></div>
<p>...±×¸®°í ´ÙÀ½Àº user@host¿¡ µû¶ó °ÅºÎÇÑ´Ù:</p>
-<div class="example"><pre>
-RewriteCond %{REMOTE_IDENT}@%{REMOTE_HOST} <strong>^badguy@badhost\.mydomain\.com$</strong>
-RewriteRule !^http://[^/.]\.mydomain.com.* - [F]
-</pre></div>
+<div class="example"><pre>RewriteCond %{REMOTE_IDENT}@%{REMOTE_HOST} <strong>^badguy@badhost\.mydomain\.com$</strong>
+RewriteRule !^http://[^/.]\.mydomain.com.* - [F]</pre></div>
</dd>
</dl>
<dd>
<p>Ä£±¸¸¸ Á¢±ÙÀÌ °¡´ÉÇϵµ·Ï ÀçÀÛ¼º ±ÔÄ¢µéÀ» »ç¿ëÇÑ´Ù:</p>
-<div class="example"><pre>
-RewriteCond %{REMOTE_IDENT}@%{REMOTE_HOST} <strong>!^friend1@client1.quux-corp\.com$</strong>
+<div class="example"><pre>RewriteCond %{REMOTE_IDENT}@%{REMOTE_HOST} <strong>!^friend1@client1.quux-corp\.com$</strong>
RewriteCond %{REMOTE_IDENT}@%{REMOTE_HOST} <strong>!^friend2</strong>@client2.quux-corp\.com$
RewriteCond %{REMOTE_IDENT}@%{REMOTE_HOST} <strong>!^friend3</strong>@client3.quux-corp\.com$
-RewriteRule ^/~quux/only-for-friends/ - [F]
-</pre></div>
+RewriteRule ^/~quux/only-for-friends/ - [F]</pre></div>
</dd>
</dl>
<dd>
<p>´ÙÀ½°ú °°ÀÌ º¹ÀâÇÑ ±ÔÄ¢À»...</p>
-<div class="example"><pre>
-RewriteMap deflector txt:/path/to/deflector.map
+<div class="example"><pre>RewriteMap deflector txt:/path/to/deflector.map
RewriteCond %{HTTP_REFERER} !=""
RewriteCond ${deflector:%{HTTP_REFERER}} ^-$
RewriteCond %{HTTP_REFERER} !=""
RewriteCond ${deflector:%{HTTP_REFERER}|NOT-FOUND} !=NOT-FOUND
-RewriteRule ^.* ${deflector:%{HTTP_REFERER}} [R,L]
-</pre></div>
+RewriteRule ^.* ${deflector:%{HTTP_REFERER}} [R,L]</pre></div>
<p>... ÀçÀÛ¼º ¸Ê°ú °°ÀÌ »ç¿ëÇÑ´Ù:</p>
-<div class="example"><pre>
-##
+<div class="example"><pre>##
## deflector.map
##
http://www.badguys.com/bad/index.html -
http://www.badguys.com/bad/index2.html -
-http://www.badguys.com/bad/index3.html http://somewhere.com/
-</pre></div>
+http://www.badguys.com/bad/index3.html http://somewhere.com/</pre></div>
<p>±×·¯¸é ¿äûÀ» ÀÚµ¿À¸·Î (¸Ê¿¡¼ °ªÀ¸·Î "<code>-</code>"¸¦
»ç¿ëÇÑ °æ¿ì) ÂüÁ¶ÆäÀÌÁö³ª (URLÀÌ ¸Ê¿¡ ÀÖ´Â °æ¿ì µÎ¹øÂ°
<code>STDIN</code>¿¡¼ ¿äûÇÑ URLÀ» ¹Þ°í, (°°Àº ¼ø¼·Î!)
°á°ú (º¸Åë ÀçÀÛ¼ºµÈ) URLÀ» <code>STDOUT</code>¿¡ Ãâ·ÂÇÑ´Ù.</p>
-<div class="example"><pre>
-RewriteEngine on
+<div class="example"><pre>RewriteEngine on
RewriteMap quux-map <strong>prg:</strong>/path/to/map.quux.pl
RewriteRule ^/~quux/(.*)$ /~quux/<strong>${quux-map:$1}</strong>
</pre></div>
-<div class="example"><pre>
-#!/path/to/perl
+<div class="example"><pre>#!/path/to/perl
# ¾ÆÆÄÄ¡ ¼¹ö°¡ ¸ØÃßÁö ¾Êµµ·Ï
# ÀÔÃâ·Â ¹öÆÛ¸¦ »ç¿ëÇÏÁö ¾Ê´Â´Ù
while (<>) {
s|^foo/|bar/|;
print $_;
-}
-</pre></div>
+}</pre></div>
<p>¼³¸íÇϱâÀ§ÇØ ¸ðµç <code>/~quux/foo/...</code> URLÀ»
<code>/~quux/bar/...</code>·Î ÀçÀÛ¼ºÇÏ´Â ½ºÅ©¸³Æ®¸¦
the Authentication and DBD frameworks. Please note that you need
to load an authorization module, such as <code class="module"><a href="../mod/mod_authz_user.html">mod_authz_user</a></code>,
to get it working.</p>
-<div class="example"><pre>
-# mod_dbd configuration
+<div class="example"><pre># mod_dbd configuration
DBDriver pgsql
DBDParams "dbname=apacheauth user=apache password=xxxxxx"
# mod_authn_dbd SQL query to authenticate a user
AuthDBDUserPWQuery \
"SELECT password FROM authn WHERE user = %s"
-</Directory>
-</pre></div>
+</Directory></pre></div>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="exposed" id="exposed">Exposing Login Information</a></h2>
will be passed as a single string parameter when the SQL query is
executed. It may be referenced within the query statement using
a <code>%s</code> format specifier.</p>
- <div class="example"><h3>Example</h3><pre>
-AuthDBDUserPWQuery \
- "SELECT password FROM authn WHERE user = %s"
-</pre></div>
+ <div class="example"><h3>Example</h3><pre>AuthDBDUserPWQuery \
+ "SELECT password FROM authn WHERE user = %s"</pre></div>
<p>The first column value of the first row returned by the query
statement should be a string containing the encrypted password.
Subsequent rows will be ignored. If no rows are returned, the user
The user's ID and the realm, in that order, will be passed as string
parameters when the SQL query is executed. They may be referenced
within the query statement using <code>%s</code> format specifiers.</p>
- <div class="example"><h3>Example</h3><pre>
-AuthDBDUserRealmQuery \
- "SELECT password FROM authn WHERE user = %s AND realm = %s"
-</pre></div>
+ <div class="example"><h3>Example</h3><pre>AuthDBDUserRealmQuery \
+ "SELECT password FROM authn WHERE user = %s AND realm = %s"</pre></div>
<p>The first column value of the first row returned by the query
statement should be a string containing the encrypted password.
Subsequent rows will be ignored. If no rows are returned, the user
authentication to it is a matter of adding the following
directives to <em>every</em> <code>.htaccess</code> file
that gets created in the web</p>
-<div class="example"><pre>
-AuthLDAPURL "the url"
+<div class="example"><pre>AuthLDAPURL "the url"
AuthGroupFile <em>mygroupfile</em>
Require group <em>mygroupfile</em>
</pre></div>
<p>If the value begins with exec: the resulting command will be
executed and the first line returned to standard output by the
program will be used as the password.</p>
-<div class="example"><pre>
-#Password used as-is
+<div class="example"><pre>#Password used as-is
AuthLDAPBindPassword secret
#Run /path/to/program to get my password
AuthLDAPBindPassword exec:/path/to/program
#Run /path/to/otherProgram and provide arguments
-AuthLDAPBindPassword "exec:/path/to/otherProgram argument1"
-</pre></div>
+AuthLDAPBindPassword "exec:/path/to/otherProgram argument1"</pre></div>
</div>
l'authentification LDAP consiste à ajouter les directives suivantes
à <em>chaque</em> fichier <code>.htaccess</code> qui sera créé dans
le site web :</p>
-<div class="example"><pre>
-AuthLDAPURL "l'url"
+<div class="example"><pre>AuthLDAPURL "l'url"
AuthGroupFile <em>mon-fichier-de-groupes</em>
Require group <em>mon-fichier-de-groupes</em>
</pre></div>
commande correspondante est exécutée, et c'est la première ligne qui
sera renvoyée par la commande sur la sortie standard qui sera
utilisée comme mot de passe.</p>
-<div class="example"><pre>
-# Mot de passe spécifié directement
+<div class="example"><pre># Mot de passe spécifié directement
AuthLDAPBindPassword secret
# Exécution de /path/to/program pour obtenir le mot de passe
AuthLDAPBindPassword exec:/path/to/program
# Exécution de /path/to/program avec un argument pour obtenir le mot de passe
-AuthLDAPBindPassword "exec:/path/to/otherProgram argument1"
-</pre></div>
+AuthLDAPBindPassword "exec:/path/to/otherProgram argument1"</pre></div>
</div>
<code class="module"><a href="../mod/mod_autoindex.html">mod_autoindex</a></code> tarafından son argüman olarak ele
alınacak ve çözümleme işlemi o noktada duracaktır.</p>
- <div class="example"><pre>
-<form action="" method="get">
+ <div class="example"><pre><form action="" method="get">
<input type="text" name="P" value="*" /> ile eşleşen
<select name="C">
<option value="N" selected="selected">isme</option>
scheme can be accomplished with <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> as in the
following example.</p>
- <pre class="prettyprint lang-config">
-RewriteEngine On
+ <pre class="prettyprint lang-config">RewriteEngine On
RewriteCond %{HTTPS} =off
RewriteRule . - [E=protocol:http]
RewriteRule ^/mirror/foo/(.*) %{ENV:protocol}://backend.example.com/$1 [P]
ProxyPassReverse /mirror/foo/ http://backend.example.com/
-ProxyPassReverse /mirror/foo/ https://backend.example.com/
- </pre>
+ProxyPassReverse /mirror/foo/ https://backend.example.com/</pre>
</div>
protocole peut être effectuée à l'aide de
<code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> comme dans l'exemple suivant :</p>
- <pre class="prettyprint lang-config">
-RewriteEngine On
+ <pre class="prettyprint lang-config">RewriteEngine On
RewriteCond %{HTTPS} =off
RewriteRule . - [E=protocol:http]
RewriteRule ^/mirror/foo/(.*) %{ENV:protocol}://backend.example.com/$1 [P]
ProxyPassReverse /mirror/foo/ http://backend.example.com/
-ProxyPassReverse /mirror/foo/ https://backend.example.com/
- </pre>
+ProxyPassReverse /mirror/foo/ https://backend.example.com/</pre>
<h2><a name="rpacetstruct" id="rpacetstruct">Request Packet Structure</a></h2>
<p>For messages from the server to the container of type
<em>Forward Request</em>:</p>
- <div class="example"><pre>
-AJP13_FORWARD_REQUEST :=
+ <div class="example"><pre>AJP13_FORWARD_REQUEST :=
prefix_code (byte) 0x02 = JK_AJP13_FORWARD_REQUEST
method (byte)
protocol (string)
num_headers (integer)
request_headers *(req_header_name req_header_value)
attributes *(attribut_name attribute_value)
- request_terminator (byte) OxFF
- </pre></div>
+ request_terminator (byte) OxFF</pre></div>
<p>The <code>request_headers</code> have the following structure:
- </p><div class="example"><pre>
-req_header_name :=
+ </p><div class="example"><pre>req_header_name :=
sc_req_header_name | (string) [see below for how this is parsed]
sc_req_header_name := 0xA0xx (integer)
-req_header_value := (string)
-</pre></div>
+req_header_value := (string)</pre></div>
<p>The <code>attributes</code> are optional and have the following
structure:</p>
- <div class="example"><pre>
-attribute_name := sc_a_name | (sc_a_req_attribute string)
+ <div class="example"><pre>attribute_name := sc_a_name | (sc_a_req_attribute string)
-attribute_value := (string)
-
- </pre></div>
+attribute_value := (string)</pre></div>
<p>Not that the all-important header is <code>content-length</code>,
because it determines whether or not the container looks for another
packet immediately.</p>
<div class="section">
<h2><a name="resppacketstruct" id="resppacketstruct">Response Packet Structure</a></h2>
<p>for messages which the container can send back to the server.</p>
- <div class="example"><pre>
-AJP13_SEND_BODY_CHUNK :=
+ <div class="example"><pre>AJP13_SEND_BODY_CHUNK :=
prefix_code 3
chunk_length (integer)
chunk *(byte)
AJP13_GET_BODY_CHUNK :=
prefix_code 6
- requested_length (integer)
- </pre></div>
+ requested_length (integer)</pre></div>
<h3>Details:</h3>
<h3>Send Body Chunk</h3>
<p>The chunk is basically binary data, and is sent directly back to the
<h2><a name="rpacetstruct" id="rpacetstruct">リクエストパケット構造</a></h2>
<p>サーバからコンテナへ送られるメッセージが
<em>Forward Request</em> 型の場合 :</p>
- <div class="example"><pre>
-AJP13_FORWARD_REQUEST :=
+ <div class="example"><pre>AJP13_FORWARD_REQUEST :=
prefix_code (byte) 0x02 = JK_AJP13_FORWARD_REQUEST
method (byte)
protocol (string)
num_headers (integer)
request_headers *(req_header_name req_header_value)
attributes *(attribut_name attribute_value)
- request_terminator (byte) OxFF
- </pre></div>
+ request_terminator (byte) OxFF</pre></div>
<p><code>request_headers</code> は次のような構造になっています :
- </p><div class="example"><pre>
-req_header_name :=
+ </p><div class="example"><pre>req_header_name :=
sc_req_header_name | (string) [see below for how this is parsed]
sc_req_header_name := 0xA0xx (integer)
-req_header_value := (string)
-</pre></div>
+req_header_value := (string)</pre></div>
<p><code>属性</code> はオプションで、次のような構造をしています :</p>
- <div class="example"><pre>
-attribute_name := sc_a_name | (sc_a_req_attribute string)
+ <div class="example"><pre>attribute_name := sc_a_name | (sc_a_req_attribute string)
-attribute_value := (string)
-
- </pre></div>
+attribute_value := (string)</pre></div>
<p>もっとも重要なヘッダは <code>content-length</code> だということに
注意してください。コンテナは次のパケットを探すかどうかを、
それを見て決めるからです。</p>
<div class="section">
<h2><a name="resppacketstruct" id="resppacketstruct">レスポンスパケット構造</a></h2>
<p>コンテナがサーバに送り返すことのできるメッセージ:</p>
- <div class="example"><pre>
-AJP13_SEND_BODY_CHUNK :=
+ <div class="example"><pre>AJP13_SEND_BODY_CHUNK :=
prefix_code 3
chunk_length (integer)
chunk *(byte)
AJP13_GET_BODY_CHUNK :=
prefix_code 6
- requested_length (integer)
- </pre></div>
+ requested_length (integer)</pre></div>
<h3>詳細 :</h3>
<h3>Send Body Chunk</h3>
<p>チャンクは基本的にはバイナリデータで、ブラウザに直接送られます。</p>
primarily used to rewrite logical URLs to physical
pathnames.</p>
-<div class="example"><h3>Example</h3><pre>
-SCRIPT_NAME=/sw/lib/w3s/tree/global/u/rse/.www/index.html
+<div class="example"><h3>Example</h3><pre>SCRIPT_NAME=/sw/lib/w3s/tree/global/u/rse/.www/index.html
SCRIPT_FILENAME=/u/rse/.www/index.html
SCRIPT_URL=/u/rse/
-SCRIPT_URI=http://en1.engelschall.com/u/rse/
-</pre></div>
+SCRIPT_URI=http://en1.engelschall.com/u/rse/</pre></div>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
since the resource was not relative to the document root. This
misconfiguration would normally cause the server to look for an "opt"
directory under the document root.</p>
-<div class="example"><pre>
-DocumentRoot /var/www/example.com
+<div class="example"><pre>DocumentRoot /var/www/example.com
Alias /myapp /opt/myapp-1.2.3
<Directory /opt/myapp-1.2.3>
RewriteEngine On
RewriteBase /myapp/
RewriteRule ^index\.html$ welcome.html
-</Directory>
-</pre></div>
+</Directory></pre></div>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
Use this to combine rule conditions with a local OR
instead of the implicit AND. Typical example:
-<div class="example"><pre>
-RewriteCond %{REMOTE_HOST} =host1 [OR]
+<div class="example"><pre>RewriteCond %{REMOTE_HOST} =host1 [OR]
RewriteCond %{REMOTE_HOST} =host2 [OR]
RewriteCond %{REMOTE_HOST} =host3
-RewriteRule ...some special stuff for any of these hosts...
-</pre></div>
+RewriteRule ...some special stuff for any of these hosts...</pre></div>
Without this flag you would have to write the condition/rule
pair three times.
``<code>User-Agent:</code>'' header of the request, you can
use the following: </p>
-<div class="example"><pre>
-RewriteCond %{HTTP_USER_AGENT} ^Mozilla
+<div class="example"><pre>RewriteCond %{HTTP_USER_AGENT} ^Mozilla
RewriteRule ^/$ /homepage.max.html [L]
RewriteCond %{HTTP_USER_AGENT} ^Lynx
RewriteRule ^/$ /homepage.min.html [L]
-RewriteRule ^/$ /homepage.std.html [L]
-</pre></div>
+RewriteRule ^/$ /homepage.std.html [L]</pre></div>
<p>Explanation: If you use a browser which identifies itself
as 'Mozilla' (including Netscape Navigator, Mozilla etc), then you
<em>SubstValue</em></strong>
</p>
-<div class="example"><h3>Example</h3><pre>
-##
+<div class="example"><h3>Example</h3><pre>##
## map.txt -- rewriting map
##
Ralf.S.Engelschall rse # Bastard Operator From Hell
-Mr.Joe.Average joe # Mr. Average
-</pre></div>
+Mr.Joe.Average joe # Mr. Average</pre></div>
<div class="example"><p><code>
RewriteMap real-to-user txt:/path/to/file/map.txt
else is sent to one of the 'dynamic' pool.</p>
<p>Example:</p>
-<div class="example"><h3>Rewrite map file</h3><pre>
-##
+<div class="example"><h3>Rewrite map file</h3><pre>##
## map.txt -- rewriting map
##
static www1|www2|www3|www4
-dynamic www5|www6
-</pre></div>
+dynamic www5|www6</pre></div>
<div class="example"><h3>Configuration directives</h3><p><code>
RewriteMap servers rnd:/path/to/file/map.txt<br />
context that does not have <code class="directive">RewriteEngine</code> set to
<code>on</code></p>.
-<div class="example"><pre>
-#!/usr/bin/perl
+<div class="example"><pre>#!/usr/bin/perl
$| = 1;
while (<STDIN>) {
# ...put here any transformations or lookups...
print $_;
-}
-</pre></div>
+}</pre></div>
<p>But be very careful:</p>
(the [R] flag is redundant)
^/somepath(.*) http://otherhost/otherpath$1 [P] http://otherhost/otherpath/pathinfo
- via internal proxy
-</pre></div>
+ via internal proxy</pre></div>
<p><strong>Inside per-directory configuration for
<code>/somepath</code><br />
(the [R] flag is redundant)
^localpath(.*) http://otherhost/otherpath$1 [P] http://otherhost/otherpath/pathinfo
- via internal proxy
-</pre></div>
+ via internal proxy</pre></div>
</div>
</div>
le savoir car le processus de réécriture est principalement
utilisé pour réécrire des URLs logiques en chemins physiques.</p>
-<div class="example"><h3>Exemple</h3><pre>
-SCRIPT_NAME=/sw/lib/w3s/tree/global/u/rse/.www/index.html
+<div class="example"><h3>Exemple</h3><pre>SCRIPT_NAME=/sw/lib/w3s/tree/global/u/rse/.www/index.html
SCRIPT_FILENAME=/u/rse/.www/index.html
SCRIPT_URL=/u/rse/
-SCRIPT_URI=http://en1.engelschall.com/u/rse/
-</pre></div>
+SCRIPT_URI=http://en1.engelschall.com/u/rse/</pre></div>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
de configuration aurait conduit le serveur à rechercher un répertoire
"opt" à la racine des documents.</p>
-<div class="example"><pre>
-DocumentRoot /var/www/example.com
+<div class="example"><pre>DocumentRoot /var/www/example.com
Alias /myapp /opt/myapp-1.2.3
<Directory /opt/myapp-1.2.3>
RewriteEngine On
RewriteBase /myapp/
RewriteRule ^index\.html$ welcome.html
-</Directory>
-</pre></div>
+</Directory></pre></div>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
Permet de chaîner les conditions de règles avec un OU au
lieu du AND implicite. Exemple typique :
-<div class="example"><pre>
-RewriteCond %{REMOTE_HOST} ^hote1 [OR]
+<div class="example"><pre>RewriteCond %{REMOTE_HOST} ^hote1 [OR]
RewriteCond %{REMOTE_HOST} ^hote2 [OR]
RewriteCond %{REMOTE_HOST} ^hote3
-RewriteRule ...règles concernant tous ces hôtes...
-</pre></div>
+RewriteRule ...règles concernant tous ces hôtes...</pre></div>
Sans ce drapeau, les paires
condition/règle devraient être écrites trois fois.
l'en-tête ``<code>User-Agent:</code>'' de la requête, vous
pouvez utiliser ce qui suit : </p>
-<div class="example"><pre>
-RewriteCond %{HTTP_USER_AGENT} ^Mozilla
+<div class="example"><pre>RewriteCond %{HTTP_USER_AGENT} ^Mozilla
RewriteRule ^/$ /homepage.max.html [L]
RewriteCond %{HTTP_USER_AGENT} ^Lynx
RewriteRule ^/$ /homepage.min.html [L]
-RewriteRule ^/$ /homepage.std.html [L]
-</pre></div>
+RewriteRule ^/$ /homepage.std.html [L]</pre></div>
<p>Explications : si vous utilisez un navigateur
(Netscape Navigator, Mozilla etc) qui s'identifie comme
<em>valeur de remplacement</em></strong>
</p>
-<div class="example"><h3>Exemple</h3><pre>
-##
+<div class="example"><h3>Exemple</h3><pre>##
## map.txt -- table de correspondance pour la réécriture
##
Ralf.S.Engelschall rse # Bastard Operator From Hell
(traduction à votre convenance)
-Mr.Joe.Average joe # Mr. Average
-</pre></div>
+Mr.Joe.Average joe # Mr. Average</pre></div>
<div class="example"><p><code>
RewriteMap real-to-user txt:/chemin/vers/fichier/map.txt
"dynamique".</p>
<p>Exemple:</p>
-<div class="example"><h3>Fichier de correspondances pour la réécriture</h3><pre>
-##
+<div class="example"><h3>Fichier de correspondances pour la réécriture</h3><pre>##
## map.txt -- correspondances pour la réécriture
##
static www1|www2|www3|www4
-dynamic www5|www6
-</pre></div>
+dynamic www5|www6</pre></div>
<div class="example"><h3>Directives de configuration</h3><p><code>
RewriteMap serveurs rnd:/chemin/vers/fichier/map.txt<br />
<code class="directive">RewriteEngine</code> n'a pas été définie à
<code>on</code>.</p>
-<div class="example"><pre>
-#!/usr/bin/perl
+<div class="example"><pre>#!/usr/bin/perl
$| = 1;
while (<STDIN>) {
# ...insérer ici le code de transformation ou de recherche...
print $_;
-}
-</pre></div>
+}</pre></div>
<p>Mais soyez très prudent :</p>
redondant)
^/chemin(.*) http://autre hôte/autre-chemin$1 [P] http://autre hôte/autre-chemin/infochemin
- via un mandataire interne
-</pre></div>
+ via un mandataire interne</pre></div>
<p><strong>Dans une configuration de niveau répertoire pour
<code>/chemin</code><br />
redondant)
^chemin-local(.*) http://autre hôte/autre-chemin$1 [P] http://autre hôte/autre-chemin/infochemin
- via un mandataire interne
-</pre></div>
+ via un mandataire interne</pre></div>
</div>
</div>
use ciphers using RC4 and RSA. Next include the high, medium and then the low
security ciphers. Finally <em>pull</em> all SSLv2 and export ciphers to the
end of the list.</p>
-<div class="example"><pre>
-$ openssl ciphers -v 'ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP'
+<div class="example"><pre>$ openssl ciphers -v 'ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP'
NULL-SHA SSLv3 Kx=RSA Au=RSA Enc=None Mac=SHA1
NULL-MD5 SSLv3 Kx=RSA Au=RSA Enc=None Mac=MD5
EDH-RSA-DES-CBC3-SHA SSLv3 Kx=DH Au=RSA Enc=3DES(168) Mac=SHA1
... ... ... ... ...
EXP-RC4-MD5 SSLv3 Kx=RSA(512) Au=RSA Enc=RC4(40) Mac=MD5 export
EXP-RC2-CBC-MD5 SSLv2 Kx=RSA(512) Au=RSA Enc=RC2(40) Mac=MD5 export
-EXP-RC4-MD5 SSLv2 Kx=RSA(512) Au=RSA Enc=RC4(40) Mac=MD5 export
-</pre></div>
+EXP-RC4-MD5 SSLv2 Kx=RSA(512) Au=RSA Enc=RC4(40) Mac=MD5 export</pre></div>
<p>The complete list of particular RSA & DH ciphers for SSL is given in <a href="#table2">Table 2</a>.</p>
<div class="example"><h3>Example</h3><p><code>
SSLCipherSuite RSA:!EXP:!NULL:+HIGH:+MEDIUM:-LOW
The <em>expression</em> must match the following syntax (given as a BNF
grammar notation):</p>
<blockquote>
-<pre>
-expr ::= "<strong>true</strong>" | "<strong>false</strong>"
+<pre>expr ::= "<strong>true</strong>" | "<strong>false</strong>"
| "<strong>!</strong>" expr
| expr "<strong>&&</strong>" expr
| expr "<strong>||</strong>" expr
digit ::= [0-9]+
cstring ::= "..."
variable ::= "<strong>%{</strong>" varname "<strong>}</strong>"
-function ::= funcname "<strong>(</strong>" funcargs "<strong>)</strong>"
-</pre>
+function ::= funcname "<strong>(</strong>" funcargs "<strong>)</strong>"</pre>
</blockquote>
<p>while for <code>varname</code> any variable from <a href="#table3">Table 3</a> can be used. Finally for
<code>funcname</code> the following functions are available:</p>
</p>
<p><em>Standard CGI/1.0 and Apache variables:</em></p>
-<pre>
-HTTP_USER_AGENT PATH_INFO AUTH_TYPE
+<pre>HTTP_USER_AGENT PATH_INFO AUTH_TYPE
HTTP_REFERER QUERY_STRING SERVER_SOFTWARE
HTTP_COOKIE REMOTE_HOST API_VERSION
HTTP_FORWARDED REMOTE_IDENT TIME_YEAR
REQUEST_METHOD SERVER_PROTOCOL TIME_WDAY
REQUEST_SCHEME REMOTE_ADDR TIME
REQUEST_URI REMOTE_USER ENV:<strong>variablename</strong>
-REQUEST_FILENAME
-</pre>
+REQUEST_FILENAME</pre>
<p><em>SSL-related variables:</em></p>
-<pre>
-HTTPS SSL_CLIENT_M_VERSION SSL_SERVER_M_VERSION
+<pre>HTTPS SSL_CLIENT_M_VERSION SSL_SERVER_M_VERSION
SSL_CLIENT_M_SERIAL SSL_SERVER_M_SERIAL
SSL_PROTOCOL SSL_CLIENT_V_START SSL_SERVER_V_START
SSL_SESSION_ID SSL_CLIENT_V_END SSL_SERVER_V_END
SSL_CLIENT_A_KEY SSL_SERVER_A_KEY
SSL_CLIENT_CERT SSL_SERVER_CERT
SSL_CLIENT_CERT_CHAIN_<strong>n</strong>
- SSL_CLIENT_VERIFY SSL_TLS_SNI
-</pre>
+ SSL_CLIENT_VERIFY SSL_TLS_SNI</pre>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<p>(the following is from message
<022701bda43d$9d32bbb0$1201a8c0@christian.office.sane.com>
in the new-httpd archives) </p>
-<pre>
-From: "Christian Allen" <christian@sane.com>
+<pre>From: "Christian Allen" <christian@sane.com>
Subject: Re: Apache Y2K bug in mod_usertrack.c
Date: Tue, 30 Jun 1998 11:41:56 -0400
(2037). Mozilla 4.x understands up until at least "50" (2050) in 2-digit
form, but also understands 4-digit years, which can probably reach up until
9999. Your best bet for sending a long-life cookie is to send it for some
-time late in the year "37".
-</pre>
+time late in the year "37".</pre>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
</div>
-<pre>
-Date: Wed, 05 Nov 1997 16:59:34 -0800
+<pre>Date: Wed, 05 Nov 1997 16:59:34 -0800
From: Rick Jones <<a href="mailto:raj@cup.hp.com">raj@cup.hp.com</a>>
Reply-To: <a href="mailto:raj@cup.hp.com">raj@cup.hp.com</a>
Organization: Network Performance
-Subject: HP-UX tuning tips
-</pre>
+Subject: HP-UX tuning tips</pre>
<p>Here are some tuning tips for HP-UX to add to the tuning page.</p>
ÃÖ±Ù¿¡ º¯°æµÈ ³»¿ëÀº ¿µ¾î ¹®¼¸¦ Âü°íÇϼ¼¿ä.</div>
-<pre>
-Date: Wed, 05 Nov 1997 16:59:34 -0800
+<pre>Date: Wed, 05 Nov 1997 16:59:34 -0800
From: Rick Jones <<a href="mailto:raj@cup.hp.com">raj@cup.hp.com</a>>
Reply-To: <a href="mailto:raj@cup.hp.com">raj@cup.hp.com</a>
Organization: Network Performance
-Subject: HP-UX tuning tips
-</pre>
+Subject: HP-UX tuning tips</pre>
<p>ÀÌ ±ÛÀº ¼º´ÉÇâ»ó ÆäÀÌÁö¿¡ Ãß°¡ÇÒ HP-UX ¼º´ÉÇâ»ó ÆÁÀÌ´Ù.</p>
ÀÖ´Ù. Windows NT¿¡¼ <code>release</code>¿Í <code>debug</code>
ÄÄÆÄÀÏÇÏ´Â ¸í·É¾î´Â °¢°¢ ´ÙÀ½°ú °°´Ù:</p>
- <div class="example"><pre>
-nmake /f Makefile.win _apacher
+ <div class="example"><pre>nmake /f Makefile.win _apacher
-nmake /f Makefile.win _apached
- </pre></div>
+nmake /f Makefile.win _apached</pre></div>
<p>µÎ ¸í·É¾î ¸ðµÎ ¾ÆÆÄÄ¡¸¦ ÄÄÆÄÀÏÇÑ´Ù. ÈÄÀÚ´Â °á°úÆÄÀÏ¿¡
µð¹ö±ë Á¤º¸¸¦ Æ÷ÇÔÇÏ¿© ¹ö±×¸¦ ã°í ¹®Á¦¸¦ ÃßÀûÇϱ⠽±°Ô
<p>ÄÄÆÄÀÏÇÏ°í ¸ðµç ÆÄÀÏÀ» ¿øÇÏ´Â Æú´õ <em>dir</em>¿¡ ÀÚµ¿À¸·Î
¼³Ä¡ÇÏ·Á¸é ´ÙÀ½ <code>nmake</code> ¸í·É¾îÁß Çϳª¸¦ »ç¿ëÇÑ´Ù:</p>
- <div class="example"><pre>
-nmake /f Makefile.win installr INSTDIR=<em>dir</em>
+ <div class="example"><pre>nmake /f Makefile.win installr INSTDIR=<em>dir</em>
nmake /f Makefile.win installd INSTDIR=<em>dir</em>
</pre></div>
<dd>
This is done via the following ruleset:
-<pre class="prettyprint lang-config">
-# This example is valid in per-directory context only
+<pre class="prettyprint lang-config"># This example is valid in per-directory context only
RewriteCond %{REQUEST_URI} !-U
-RewriteRule ^(.+)\.html$ /regenerate_page.cgi [PT,L]
-</pre>
+RewriteRule ^(.+)\.html$ /regenerate_page.cgi [PT,L]</pre>
<p>The <code>-U</code> operator determines whether the test string
one would usually say "left as an exercise to the reader"
;-) I will provide this, too.</p>
-<div class="example"><pre>
-#!/sw/bin/perl
+<div class="example"><pre>#!/sw/bin/perl
##
## nph-refresh -- NPH/CGI script for auto refreshing pages
## Copyright (c) 1997 Ralf S. Engelschall, All Rights Reserved.
exit(0);
-##EOF##
-</pre></div>
+##EOF##</pre></div>
</dd>
</dl>
-keyout server.key</strong></code><br />
These can be used as follows in your <code>httpd.conf</code>
file:
- <pre>
- SSLCertificateFile /path/to/this/server.crt
- SSLCertificateKeyFile /path/to/this/server.key
- </pre>
+ <pre> SSLCertificateFile /path/to/this/server.crt
+ SSLCertificateKeyFile /path/to/this/server.key</pre>
</li>
<li>It is important that you are aware that this
<code>server.key</code> does <em>not</em> have any passphrase.
<li>You should now have two files: <code>server.key</code> and
<code>server.crt</code>. These can be used as follows in your
<code>httpd.conf</code> file:
- <pre>
- SSLCertificateFile /path/to/this/server.crt
- SSLCertificateKeyFile /path/to/this/server.key
- </pre>
+ <pre> SSLCertificateFile /path/to/this/server.crt
+ SSLCertificateKeyFile /path/to/this/server.key</pre>
The <code>server.csr</code> file is no longer needed.
</li>
you should establish a password database containing <em>all</em>
clients allowed, as follows:</p>
- <div class="example"><h3>httpd.conf</h3><pre>
-SSLCACertificateFile conf/ssl.crt/ca.crt
+ <div class="example"><h3>httpd.conf</h3><pre>SSLCACertificateFile conf/ssl.crt/ca.crt
SSLCACertificatePath conf/ssl.crt
SSLVerifyClient none
See the <code class="directive"><a href="../mod/mod_ssl.html#ssloptions">SSLOptions</a></code> docs for more
information.</p>
- <div class="example"><h3>httpd.passwd</h3><pre>
-/C=DE/L=Munich/O=Snake Oil, Ltd./OU=Staff/CN=Foo:xxj31ZMTZzkVA
+ <div class="example"><h3>httpd.passwd</h3><pre>/C=DE/L=Munich/O=Snake Oil, Ltd./OU=Staff/CN=Foo:xxj31ZMTZzkVA
/C=US/L=S.F./O=Snake Oil, Ltd./OU=CA/CN=Bar:xxj31ZMTZzkVA
/C=US/L=L.A./O=Snake Oil, Ltd./OU=Dev/CN=Quux:xxj31ZMTZzkVA</pre></div>
into the DN, you can match them more easily using <code class="directive"><a href="../mod/mod_ssl.html#sslrequire">SSLRequire</a></code>, as follows:</p>
- <div class="example"><h3>httpd.conf</h3><pre>
-SSLVerifyClient none
+ <div class="example"><h3>httpd.conf</h3><pre>SSLVerifyClient none
SSLCACertificateFile conf/ssl.crt/ca.crt
SSLCACertificatePath conf/ssl.crt
This configuration should remain outside of your HTTPS virtual host, so
that it applies to both HTTPS and HTTP.</p>
- <div class="example"><h3>httpd.conf</h3><pre>
-SSLCACertificateFile conf/ssl.crt/company-ca.crt
+ <div class="example"><h3>httpd.conf</h3><pre>SSLCACertificateFile conf/ssl.crt/company-ca.crt
<Directory /usr/local/apache2/htdocs>
# Outside the subarea only Intranet access is granted