diff options
Diffstat (limited to '')
-rw-r--r-- | docs/manual/sections.html | 21 | ||||
-rw-r--r-- | docs/manual/sections.html.en | 607 | ||||
-rw-r--r-- | docs/manual/sections.html.fr.utf8 | 687 | ||||
-rw-r--r-- | docs/manual/sections.html.ja.utf8 | 523 | ||||
-rw-r--r-- | docs/manual/sections.html.ko.euc-kr | 452 | ||||
-rw-r--r-- | docs/manual/sections.html.tr.utf8 | 656 |
6 files changed, 2946 insertions, 0 deletions
diff --git a/docs/manual/sections.html b/docs/manual/sections.html new file mode 100644 index 0000000..2f35046 --- /dev/null +++ b/docs/manual/sections.html @@ -0,0 +1,21 @@ +# GENERATED FROM XML -- DO NOT EDIT + +URI: sections.html.en +Content-Language: en +Content-type: text/html; charset=UTF-8 + +URI: sections.html.fr.utf8 +Content-Language: fr +Content-type: text/html; charset=UTF-8 + +URI: sections.html.ja.utf8 +Content-Language: ja +Content-type: text/html; charset=UTF-8 + +URI: sections.html.ko.euc-kr +Content-Language: ko +Content-type: text/html; charset=EUC-KR + +URI: sections.html.tr.utf8 +Content-Language: tr +Content-type: text/html; charset=UTF-8 diff --git a/docs/manual/sections.html.en b/docs/manual/sections.html.en new file mode 100644 index 0000000..71885e9 --- /dev/null +++ b/docs/manual/sections.html.en @@ -0,0 +1,607 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head> +<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> +<!-- + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + This file is generated from xml source: DO NOT EDIT + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + --> +<title>Configuration Sections - Apache HTTP Server Version 2.4</title> +<link href="./style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> +<link href="./style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> +<link href="./style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="./style/css/prettify.css" /> +<script src="./style/scripts/prettify.min.js" type="text/javascript"> +</script> + +<link href="./images/favicon.ico" rel="shortcut icon" /></head> +<body id="manual-page"><div id="page-header"> +<p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html">Glossary</a> | <a href="./sitemap.html">Sitemap</a></p> +<p class="apache">Apache HTTP Server Version 2.4</p> +<img alt="" src="./images/feather.png" /></div> +<div class="up"><a href="./"><img title="<-" alt="<-" src="./images/left.gif" /></a></div> +<div id="path"> +<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="./">Version 2.4</a></div><div id="page-content"><div id="preamble"><h1>Configuration Sections</h1> +<div class="toplang"> +<p><span>Available Languages: </span><a href="./en/sections.html" title="English"> en </a> | +<a href="./fr/sections.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | +<a href="./ja/sections.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | +<a href="./ko/sections.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | +<a href="./tr/sections.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> +</div> + <p>Directives in the <a href="configuring.html">configuration files</a> may apply to the +entire server, or they may be restricted to apply only to particular +directories, files, hosts, or URLs. This document describes how to +use configuration section containers or <code>.htaccess</code> files +to change the scope of other configuration directives.</p> +</div> +<div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><ul id="toc"><li><img alt="" src="./images/down.gif" /> <a href="#types">Types of Configuration Section Containers</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#file-and-web">Filesystem, Webspace, and Boolean Expressions</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#virtualhost">Virtual Hosts</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#proxy">Proxy</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#whatwhere">What Directives are Allowed?</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#merging">How the sections are merged</a></li> +</ul><h3>See also</h3><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div> +<div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="types" id="types">Types of Configuration Section Containers</a></h2> + +<table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="./mod/core.html">core</a></code></li><li><code class="module"><a href="./mod/mod_version.html">mod_version</a></code></li><li><code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code></li></ul></td><td><ul><li><code class="directive"><a href="./mod/core.html#directory"><Directory></a></code></li><li><code class="directive"><a href="./mod/core.html#directorymatch"><DirectoryMatch></a></code></li><li><code class="directive"><a href="./mod/core.html#files"><Files></a></code></li><li><code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code></li><li><code class="directive"><a href="./mod/core.html#if"><If></a></code></li><li><code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code></li><li><code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code></li><li><code class="directive"><a href="./mod/mod_version.html#ifversion"><IfVersion></a></code></li><li><code class="directive"><a href="./mod/core.html#location"><Location></a></code></li><li><code class="directive"><a href="./mod/core.html#locationmatch"><LocationMatch></a></code></li><li><code class="directive"><a href="./mod/mod_md.html#mdomainsetsection"><MDomainSet></a></code></li><li><code class="directive"><a href="./mod/mod_proxy.html#proxy"><Proxy></a></code></li><li><code class="directive"><a href="./mod/mod_proxy.html#proxymatch"><ProxyMatch></a></code></li><li><code class="directive"><a href="./mod/core.html#virtualhost"><VirtualHost></a></code></li></ul></td></tr></table> + +<p>There are two basic types of containers. Most containers are +evaluated for each request. The enclosed directives are applied only +for those requests that match the containers. The <code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code>, <code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code>, and +<code class="directive"><a href="./mod/mod_version.html#ifversion"><IfVersion></a></code> +containers, on the other hand, are evaluated only at server startup +and restart. If their conditions are true at startup, then the +enclosed directives will apply to all requests. If the conditions are +not true, the enclosed directives will be ignored.</p> + +<p>The <code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code> directive +encloses directives that will only be applied if an appropriate +parameter is defined on the <code class="program"><a href="./programs/httpd.html">httpd</a></code> command line. For example, +with the following configuration, all requests will be redirected +to another site only if the server is started using +<code>httpd -DClosedForNow</code>:</p> + +<pre class="prettyprint lang-config"><IfDefine ClosedForNow> + Redirect "/" "http://otherserver.example.com/" +</IfDefine></pre> + + +<p>The <code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code> +directive is very similar, except it encloses directives that will +only be applied if a particular module is available in the server. +The module must either be statically compiled in the server, or it +must be dynamically compiled and its <code class="directive"><a href="./mod/mod_so.html#loadmodule">LoadModule</a></code> line must be earlier in the +configuration file. This directive should only be used if you need +your configuration file to work whether or not certain modules are +installed. It should not be used to enclose directives that you want +to work all the time, because it can suppress useful error messages +about missing modules.</p> + +<p>In the following example, the <code class="directive"><a href="./mod/mod_mime_magic.html#mimemagicfile">MimeMagicFile</a></code> directive will be +applied only if <code class="module"><a href="./mod/mod_mime_magic.html">mod_mime_magic</a></code> is available.</p> + +<pre class="prettyprint lang-config"><IfModule mod_mime_magic.c> + MimeMagicFile "conf/magic" +</IfModule></pre> + + +<p>The <code class="directive"><a href="./mod/mod_version.html#ifversion"><IfVersion></a></code> +directive is very similar to <code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code> and <code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code>, except it encloses directives that will +only be applied if a particular version of the server is executing. This +module is designed for the use in test suites and large networks which have to +deal with different httpd versions and different configurations.</p> + +<pre class="prettyprint lang-config"><IfVersion >= 2.4> + # this happens only in versions greater or + # equal 2.4.0. +</IfVersion></pre> + + +<p><code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code>, +<code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code>, and the +<code class="directive"><a href="./mod/mod_version.html#ifversion"><IfVersion></a></code> +can apply negative conditions by preceding their test with "!". +Also, these sections can be nested to achieve more complex +restrictions.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="file-and-web" id="file-and-web">Filesystem, Webspace, and Boolean Expressions</a></h2> + +<p>The most commonly used configuration section containers are the +ones that change the configuration of particular places in the +filesystem or webspace. First, it is important to understand the +difference between the two. The filesystem is the view of your disks +as seen by your operating system. For example, in a default install, +Apache httpd resides at <code>/usr/local/apache2</code> in the Unix +filesystem or <code>"c:/Program Files/Apache Group/Apache2"</code> in +the Windows filesystem. (Note that forward slashes should always be +used as the path separator in Apache httpd configuration files, even for Windows.) In contrast, +the webspace is the view of your site as delivered by the web server +and seen by the client. So the path <code>/dir/</code> in the +webspace corresponds to the path +<code>/usr/local/apache2/htdocs/dir/</code> in the filesystem of a +default Apache httpd install on Unix. The webspace need not map directly to +the filesystem, since webpages may be generated dynamically +from databases or other locations.</p> + +<h3><a name="filesystem" id="filesystem">Filesystem Containers</a></h3> + +<p>The <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> +and <code class="directive"><a href="./mod/core.html#files"><Files></a></code> +directives, along with their <a class="glossarylink" href="./glossary.html#regex" title="see glossary">regex</a> +counterparts, apply directives to +parts of the filesystem. Directives enclosed in a <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> section apply to +the named filesystem directory and all subdirectories of that +directory (as well as the files in those directories). +The same effect can be obtained using <a href="howto/htaccess.html">.htaccess files</a>. For example, in the +following configuration, directory indexes will be enabled for the +<code>/var/web/dir1</code> directory and all subdirectories.</p> + +<pre class="prettyprint lang-config"><Directory "/var/web/dir1"> + Options +Indexes +</Directory></pre> + + +<p>Directives enclosed in a <code class="directive"><a href="./mod/core.html#files"><Files></a></code> section apply to any file with +the specified name, regardless of what directory it lies in. +So for example, the following configuration directives will, +when placed in the main section of the configuration file, +deny access to any file named <code>private.html</code> regardless +of where it is found.</p> + +<pre class="prettyprint lang-config"><Files "private.html"> + Require all denied +</Files></pre> + + +<p>To address files found in a particular part of the filesystem, the +<code class="directive"><a href="./mod/core.html#files"><Files></a></code> and +<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> sections +can be combined. For example, the following configuration will deny +access to <code>/var/web/dir1/private.html</code>, +<code>/var/web/dir1/subdir2/private.html</code>, +<code>/var/web/dir1/subdir3/private.html</code>, and any other instance +of <code>private.html</code> found under the <code>/var/web/dir1/</code> +directory.</p> + +<pre class="prettyprint lang-config"><Directory "/var/web/dir1"> + <Files "private.html"> + Require all denied + </Files> +</Directory></pre> + + + +<h3><a name="webspace" id="webspace">Webspace Containers</a></h3> + +<p>The <code class="directive"><a href="./mod/core.html#location"><Location></a></code> +directive and its <a class="glossarylink" href="./glossary.html#regex" title="see glossary">regex</a> counterpart, on +the other hand, change the +configuration for content in the webspace. For example, the following +configuration prevents access to any URL-path that begins in /private. +In particular, it will apply to requests for +<code>http://yoursite.example.com/private</code>, +<code>http://yoursite.example.com/private123</code>, and +<code>http://yoursite.example.com/private/dir/file.html</code> as well +as any other requests starting with the <code>/private</code> string.</p> + +<pre class="prettyprint lang-config"><LocationMatch "^/private"> + Require all denied +</LocationMatch></pre> + + +<p>The <code class="directive"><a href="./mod/core.html#location"><Location></a></code> +directive need not have anything to do with the filesystem. +For example, the following example shows how to map a particular +URL to an internal Apache HTTP Server handler provided by <code class="module"><a href="./mod/mod_status.html">mod_status</a></code>. +No file called <code>server-status</code> needs to exist in the +filesystem.</p> + +<pre class="prettyprint lang-config"><Location "/server-status"> + SetHandler server-status +</Location></pre> + + + +<h3><a name="overlapping-webspace" id="overlapping-webspace">Overlapping Webspace</a></h3> +<p>In order to have two overlapping URLs one has to consider the order in which +certain sections or directives are evaluated. For +<code class="directive"><a href="./mod/core.html#location"><Location></a></code> this would be:</p> +<pre class="prettyprint lang-config"><Location "/foo"> +</Location> +<Location "/foo/bar"> +</Location></pre> + +<p><code class="directive"><a href="./mod/mod_alias.html#alias"><Alias></a></code>es on the other hand, +are mapped vice-versa:</p> +<pre class="prettyprint lang-config">Alias "/foo/bar" "/srv/www/uncommon/bar" +Alias "/foo" "/srv/www/common/foo"</pre> + +<p>The same is true for the <code class="directive"><a href="./mod/mod_proxy.html#proxypass">ProxyPass</a></code> +directives:</p> +<pre class="prettyprint lang-config">ProxyPass "/special-area" "http://special.example.com" smax=5 max=10 +ProxyPass "/" "balancer://mycluster/" stickysession=JSESSIONID|jsessionid nofailover=On</pre> + + + +<h3><a name="wildcards" id="wildcards">Wildcards and Regular Expressions</a></h3> + +<p>The <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code>, +<code class="directive"><a href="./mod/core.html#files"><Files></a></code>, and +<code class="directive"><a href="./mod/core.html#location"><Location></a></code> +directives can each use shell-style wildcard characters as in +<code>fnmatch</code> from the C standard library. The character "*" +matches any sequence of characters, "?" matches any single character, +and "[<em>seq</em>]" matches any character in <em>seq</em>. The "/" +character will not be matched by any wildcard; it must be specified +explicitly.</p> + +<p>If even more flexible matching is required, each +container has a regular expression (regex) counterpart <code class="directive"><a href="./mod/core.html#directorymatch"><DirectoryMatch></a></code>, <code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code>, and <code class="directive"><a href="./mod/core.html#locationmatch"><LocationMatch></a></code> that allow +perl-compatible +<a class="glossarylink" href="./glossary.html#regex" title="see glossary">regular expressions</a> +to be used in choosing the matches. But see the section below on +configuration merging to find out how using regex sections will change +how directives are applied.</p> + +<p>A non-regex wildcard section that changes the configuration of +all user directories could look as follows:</p> + +<pre class="prettyprint lang-config"><Directory "/home/*/public_html"> + Options Indexes +</Directory></pre> + + +<p>Using regex sections, we can deny access to many types of image files +at once:</p> +<pre class="prettyprint lang-config"><FilesMatch "\.(?i:gif|jpe?g|png)$"> + Require all denied +</FilesMatch></pre> + + +<p>Regular expressions containing <strong>named groups and +backreferences</strong> are added to the environment with the +corresponding name in uppercase. This allows elements of filename paths +and URLs to be referenced from within <a href="expr.html">expressions</a> +and modules like <code class="module"><a href="./mod/mod_rewrite.html">mod_rewrite</a></code>.</p> + +<pre class="prettyprint lang-config"><DirectoryMatch "^/var/www/combined/(?<SITENAME>[^/]+)"> + Require ldap-group "cn=%{env:MATCH_SITENAME},ou=combined,o=Example" +</DirectoryMatch></pre> + + + + +<h3><a name="expressions" id="expressions">Boolean expressions</a></h3> +<p>The <code class="directive"><a href="./mod/core.html#if"><If></a></code> +directive change the configuration depending on a condition which can be +expressed by a boolean expression. For example, the following configuration +denies access if the HTTP Referer header does not start with +"http://www.example.com/".</p> +<pre class="prettyprint lang-config"><If "!(%{HTTP_REFERER} -strmatch 'http://www.example.com/*')"> + Require all denied +</If></pre> + + + + +<h3><a name="whichwhen" id="whichwhen">What to use When</a></h3> + +<p>Choosing between filesystem containers and webspace containers is +actually quite easy. When applying directives to objects that reside +in the filesystem always use <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> or <code class="directive"><a href="./mod/core.html#files"><Files></a></code>. When applying directives to objects +that do not reside in the filesystem (such as a webpage generated from +a database), use <code class="directive"><a href="./mod/core.html#location"><Location></a></code>.</p> + +<p>It is important to never use <code class="directive"><a href="./mod/core.html#location"><Location></a></code> when trying to restrict +access to objects in the filesystem. This is because many +different webspace locations (URLs) could map to the same filesystem +location, allowing your restrictions to be circumvented. +For example, consider the following configuration:</p> + +<pre class="prettyprint lang-config"><Location "/dir/"> + Require all denied +</Location></pre> + + +<p>This works fine if the request is for +<code>http://yoursite.example.com/dir/</code>. But what if you are on +a case-insensitive filesystem? Then your restriction could be easily +circumvented by requesting +<code>http://yoursite.example.com/DIR/</code>. The <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> directive, in +contrast, will apply to any content served from that location, +regardless of how it is called. (An exception is filesystem links. +The same directory can be placed in more than one part of the +filesystem using symbolic links. The <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> directive will follow the symbolic +link without resetting the pathname. Therefore, for the highest level +of security, symbolic links should be disabled with the appropriate +<code class="directive"><a href="./mod/core.html#options">Options</a></code> directive.)</p> + +<p>If you are, perhaps, thinking that none of this applies to you +because you use a case-sensitive filesystem, remember that there are +many other ways to map multiple webspace locations to the same +filesystem location. Therefore you should always use the filesystem +containers when you can. There is, however, one exception to this +rule. Putting configuration restrictions in a <code><Location +"/"></code> section is perfectly safe because this section will apply +to all requests regardless of the specific URL.</p> + + +<h3><a name="nesting" id="nesting">Nesting of sections</a></h3> + +<p>Some section types can be nested inside other section types. On the one +hand, <code class="directive"><a href="./mod/core.html#files"><Files></a></code> can be used +inside <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code>. On +the other hand, <code class="directive"><a href="./mod/core.html#if"><If></a></code> can +be used inside <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code>, +<code class="directive"><a href="./mod/core.html#location"><Location></a></code>, and <code class="directive"><a href="./mod/core.html#files"><Files></a></code> sections (but not inside another +<code class="directive"><a href="./mod/core.html#if"><If></a></code>). The regex +counterparts of the named section behave identically.</p> + +<p>Nested sections are merged after non-nested sections of the same type.</p> + + + +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="virtualhost" id="virtualhost">Virtual Hosts</a></h2> + +<p>The <code class="directive"><a href="./mod/core.html#virtualhost"><VirtualHost></a></code> +container encloses directives that apply to specific hosts. +This is useful when serving multiple hosts from the same machine +with a different configuration for each. For more information, +see the <a href="vhosts/">Virtual Host Documentation</a>.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="proxy" id="proxy">Proxy</a></h2> + +<p>The <code class="directive"><a href="./mod/mod_proxy.html#proxy"><Proxy></a></code> +and <code class="directive"><a href="./mod/mod_proxy.html#proxymatch"><ProxyMatch></a></code> +containers apply enclosed configuration directives only +to sites accessed through <code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code>'s proxy server +that match the specified URL. For example, the following configuration +will allow only a subset of clients to access the +<code>www.example.com</code> website using the proxy server:</p> + +<pre class="prettyprint lang-config"><Proxy "http://www.example.com/*"> + Require host yournetwork.example.com +</Proxy></pre> + +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="whatwhere" id="whatwhere">What Directives are Allowed?</a></h2> + +<p>To find out what directives are allowed in what types of +configuration sections, check the <a href="mod/directive-dict.html#Context">Context</a> of the directive. +Everything that is allowed in +<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> +sections is also syntactically allowed in +<code class="directive"><a href="./mod/core.html#directorymatch"><DirectoryMatch></a></code>, +<code class="directive"><a href="./mod/core.html#files"><Files></a></code>, +<code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code>, +<code class="directive"><a href="./mod/core.html#location"><Location></a></code>, +<code class="directive"><a href="./mod/core.html#locationmatch"><LocationMatch></a></code>, +<code class="directive"><a href="./mod/mod_proxy.html#proxy"><Proxy></a></code>, +and <code class="directive"><a href="./mod/mod_proxy.html#proxymatch"><ProxyMatch></a></code> +sections. There are some exceptions, however:</p> + +<ul> +<li>The <code class="directive"><a href="./mod/core.html#allowoverride">AllowOverride</a></code> directive +works only in <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> +sections.</li> + +<li>The <code>FollowSymLinks</code> and +<code>SymLinksIfOwnerMatch</code> <code class="directive"><a href="./mod/core.html#options">Options</a></code> work only in <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> sections or +<code>.htaccess</code> files.</li> + +<li>The <code class="directive"><a href="./mod/core.html#options">Options</a></code> directive cannot +be used in <code class="directive"><a href="./mod/core.html#files"><Files></a></code> +and <code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code> +sections.</li> +</ul> +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="merging" id="merging">How the sections are merged</a></h2> + +<p>The configuration sections are applied in a very particular order. +Since this can have important effects on how configuration directives +are interpreted, it is important to understand how this works.</p> + + <p>The order of merging is:</p> + + <ol> + <li> <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> (except regular expressions) + and <code>.htaccess</code> done simultaneously (with + <code>.htaccess</code>, if allowed, overriding + <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code>)</li> + + <li><code class="directive"><a href="./mod/core.html#directorymatch"><DirectoryMatch></a></code> + (and <code><Directory "~"></code>)</li> + + <li><code class="directive"><a href="./mod/core.html#files"><Files></a></code> and <code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code> done + simultaneously</li> + + <li><code class="directive"><a href="./mod/core.html#location"><Location></a></code> + and <code class="directive"><a href="./mod/core.html#locationmatch"><LocationMatch></a></code> done simultaneously</li> + + <li><code class="directive"><a href="./mod/core.html#if"><If></a></code> sections, even when + they are enclosed in any of the preceding contexts. + </li> + + </ol> + + <p>Some important remarks:</p> + <ul> + <li>Apart from <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code>, within each group the sections are + processed in the order they appear in the configuration files. + For example, a request for <em>/foo/bar</em> will match + <code><Location "/foo/bar"></code> and + <code><Location "/foo"></code> (group 4 in this case): + both sections will be evaluated + but in the order they appear in the configuration files.</li> + <li><code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> + (group 1 above) is processed in the order shortest directory + component to longest. For example, + <code><Directory "/var/web/dir"></code> will be processed before + <code><Directory "/var/web/dir/subdir"></code>.</li> + <li>If multiple <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> sections apply + to the same directory they are processed in the configuration file + order.</li> + <li>Configurations included via the <code class="directive"><a href="./mod/core.html#include">Include</a></code> directive will be treated as if + they were inside the including file at the location of the + <code class="directive"><a href="./mod/core.html#include">Include</a></code> directive.</li> + <li>Sections inside <code class="directive"><a href="./mod/core.html#virtualhost"><VirtualHost></a></code> sections + are applied <em>after</em> the corresponding sections outside + the virtual host definition. This allows virtual hosts to + override the main server configuration.</li> + <li>When the request is served by <code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code>, the + <code class="directive"><a href="./mod/mod_proxy.html#proxy"><Proxy></a></code> + container takes the place of the <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> container in the processing + order.</li> + <li> Caution should be exercised when mixing related configuration + directives inside and outside of <code class="directive"><a href="./mod/core.html#if"><If></a></code> because of the effect on merging order. Explicit use + of <code class="directive"><a href="./mod/core.html#else"><Else></a></code> can help. + </li> + <li> When <code class="directive"><a href="./mod/core.html#if"><If></a></code> is + used in <code>.htaccess</code>, the enclosed directives in a parent + directory will be merged <em>after</em> non-enclosed directives in a + subdirectory.</li> + </ul> + + <div class="note"><h3>Technical Note</h3> + There is actually a + <code><Location></code>/<code><LocationMatch></code> + sequence performed just before the name translation phase + (where <code>Aliases</code> and <code>DocumentRoots</code> + are used to map URLs to filenames). The results of this + sequence are completely thrown away after the translation has + completed. + </div> + +<h3><a name="relationship-module-configuration" id="relationship-module-configuration">Relationship between modules and configuration sections</a></h3> + <p>One question that often arises after reading how configuration sections are + merged is related to how and when directives of specific modules like <code class="module"><a href="./mod/mod_rewrite.html">mod_rewrite</a></code> + are processed. The answer is not trivial and needs a bit of background. + Each httpd module manages its own configuration, and each of its directives in httpd.conf specify one piece + of configuration in a particular context. httpd does not execute a command as it is read.</p> + <p>At runtime, the core of httpd iterates over the defined configuration sections in the order + described above to determine which ones apply to the current request. When the first section matches, + it is considered the current configuration for this request. If a subsequent section matches too, + then each module with a directive in either of the sections is given a chance to merge its configuration between the two sections. The result is a third configuration, and the process goes on until all the configuration sections + are evaluated.</p> + <p>After the above step, the "real" processing of the HTTP request begins: each module has a chance to run + and perform whatever tasks they like. They can retrieve their own final merged configuration from the core + of the httpd to determine how they should act.</p> + <p>An example can help to visualize the whole process. The following configuration uses the + <code class="directive"><a href="./mod/mod_headers.html#header">Header</a></code> directive of <code class="module"><a href="./mod/mod_headers.html">mod_headers</a></code> to set + a specific HTTP header. What value will httpd set in the <code>CustomHeaderName</code> header for a request to + <code>/example/index.html</code> ? + </p> + <pre class="prettyprint lang-config"><Directory "/"> + Header set CustomHeaderName one + <FilesMatch ".*"> + Header set CustomHeaderName three + </FilesMatch> +</Directory> + +<Directory "/example"> + Header set CustomHeaderName two +</Directory></pre> + + <ul> + <li><code class="directive">Directory</code> "/" matches and an initial configuration to set the <code>CustomHeaderName</code> header with the value <code>one</code> is created.</li> + <li><code class="directive">Directory</code> "/example" matches, and since <code class="module"><a href="./mod/mod_headers.html">mod_headers</a></code> specifies in its code to override in case of a merge, a new configuration is created to set the <code>CustomHeaderName</code> header with the value <code>two</code>.</li> + <li><code class="directive">FilesMatch</code> ".*" matches and another merge opportunity arises, causing the <code>CustomHeaderName</code> header to be set with the value <code>three</code>.</li> + <li>Eventually during the next steps of the HTTP request processing <code class="module"><a href="./mod/mod_headers.html">mod_headers</a></code> will be called and it will receive the configuration to set the <code>CustomHeaderName</code> header with the value <code>three</code>. <code class="module"><a href="./mod/mod_headers.html">mod_headers</a></code> normally uses this configuration to perform its job, namely setting the foo header. This does not mean that a module can't perform a more complex action like discarding directives because not needed or deprecated, etc..</li> + </ul> + + <p>This is true for .htaccess too since they have the same priority as <code class="directive">Directory</code> in the merge order. The important concept to understand is that configuration sections like <code class="directive">Directory</code> and <code class="directive">FilesMatch</code> are not comparable to module specific directives like <code class="directive"><a href="./mod/mod_headers.html#header">Header</a></code> or <code class="directive"><a href="./mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> because they operate on different levels. + </p> + + +<h3><a name="merge-examples" id="merge-examples">Some useful examples</a></h3> + +<p>Below is an artificial example to show the order of +merging. Assuming they all apply to the request, the directives in +this example will be applied in the order A > B > C > D > +E.</p> + +<pre class="prettyprint lang-config"><Location "/"> + E +</Location> + +<Files "f.html"> + D +</Files> + +<VirtualHost *> + <Directory "/a/b"> + B + </Directory> +</VirtualHost> + +<DirectoryMatch "^.*b$"> + C +</DirectoryMatch> + +<Directory "/a/b"> + A +</Directory></pre> + + + +<p>For a more concrete example, consider the following. Regardless of +any access restrictions placed in <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> sections, the <code class="directive"><a href="./mod/core.html#location"><Location></a></code> section will be +evaluated last and will allow unrestricted access to the server. In +other words, order of merging is important, so be careful!</p> + +<pre class="prettyprint lang-config"><Location "/"> + Require all granted +</Location> + +# Whoops! This <Directory> section will have no effect +<Directory "/"> + <RequireAll> + Require all granted + Require not host badguy.example.com + </RequireAll> +</Directory></pre> + + + + +</div></div> +<div class="bottomlang"> +<p><span>Available Languages: </span><a href="./en/sections.html" title="English"> en </a> | +<a href="./fr/sections.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | +<a href="./ja/sections.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | +<a href="./ko/sections.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | +<a href="./tr/sections.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> +</div><div class="top"><a href="#page-header"><img src="./images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Libera.chat, or sent to our <a href="https://httpd.apache.org/lists.html">mailing lists</a>.</div> +<script type="text/javascript"><!--//--><![CDATA[//><!-- +var comments_shortname = 'httpd'; +var comments_identifier = 'http://httpd.apache.org/docs/2.4/sections.html'; +(function(w, d) { + if (w.location.hostname.toLowerCase() == "httpd.apache.org") { + d.write('<div id="comments_thread"><\/div>'); + var s = d.createElement('script'); + s.type = 'text/javascript'; + s.async = true; + s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; + (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); + } + else { + d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); + } +})(window, document); +//--><!]]></script></div><div id="footer"> +<p class="apache">Copyright 2023 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html">Glossary</a> | <a href="./sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- +if (typeof(prettyPrint) !== 'undefined') { + prettyPrint(); +} +//--><!]]></script> +</body></html>
\ No newline at end of file diff --git a/docs/manual/sections.html.fr.utf8 b/docs/manual/sections.html.fr.utf8 new file mode 100644 index 0000000..deec5eb --- /dev/null +++ b/docs/manual/sections.html.fr.utf8 @@ -0,0 +1,687 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr"><head> +<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> +<!-- + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + This file is generated from xml source: DO NOT EDIT + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + --> +<title>Sections de configuration - Serveur HTTP Apache Version 2.4</title> +<link href="./style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> +<link href="./style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> +<link href="./style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="./style/css/prettify.css" /> +<script src="./style/scripts/prettify.min.js" type="text/javascript"> +</script> + +<link href="./images/favicon.ico" rel="shortcut icon" /></head> +<body id="manual-page"><div id="page-header"> +<p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html">Glossaire</a> | <a href="./sitemap.html">Plan du site</a></p> +<p class="apache">Serveur HTTP Apache Version 2.4</p> +<img alt="" src="./images/feather.png" /></div> +<div class="up"><a href="./"><img title="<-" alt="<-" src="./images/left.gif" /></a></div> +<div id="path"> +<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">Serveur HTTP</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="./">Version 2.4</a></div><div id="page-content"><div id="preamble"><h1>Sections de configuration</h1> +<div class="toplang"> +<p><span>Langues Disponibles: </span><a href="./en/sections.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="./fr/sections.html" title="Français"> fr </a> | +<a href="./ja/sections.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | +<a href="./ko/sections.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | +<a href="./tr/sections.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> +</div> + <p>Les directives des <a href="configuring.html">fichiers de configuration</a> peuvent s'appliquer +au serveur dans son ensemble, ou seulement à des répertoires, fichiers, hôtes, +ou URLs particuliers. Ce document décrit comment utiliser les conteneurs de +sections de configuration ou les fichiers <code>.htaccess</code> pour +modifier la portée des directives de configuration.</p> +</div> +<div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><ul id="toc"><li><img alt="" src="./images/down.gif" /> <a href="#types">Types de conteneurs de sections de +configuration</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#file-and-web">Système de fichiers, +arborescence du site web et expressions booléennes</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#virtualhost">Serveurs virtuels</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#proxy">Mandataire</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#whatwhere">Quelles sont les directives autorisées ?</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#merging">Comment les sections sont combinées entre elles</a></li> +</ul><h3>Voir aussi</h3><ul class="seealso"><li><a href="#comments_section">Commentaires</a></li></ul></div> +<div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="types" id="types">Types de conteneurs de sections de +configuration</a></h2> + +<table class="related"><tr><th>Modules Apparentés</th><th>Directives Apparentées</th></tr><tr><td><ul><li><code class="module"><a href="./mod/core.html">core</a></code></li><li><code class="module"><a href="./mod/mod_version.html">mod_version</a></code></li><li><code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code></li></ul></td><td><ul><li><code class="directive"><a href="./mod/core.html#directory"><Directory></a></code></li><li><code class="directive"><a href="./mod/core.html#directorymatch"><DirectoryMatch></a></code></li><li><code class="directive"><a href="./mod/core.html#files"><Files></a></code></li><li><code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code></li><li><code class="directive"><a href="./mod/core.html#if"><If></a></code></li><li><code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code></li><li><code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code></li><li><code class="directive"><a href="./mod/mod_version.html#ifversion"><IfVersion></a></code></li><li><code class="directive"><a href="./mod/core.html#location"><Location></a></code></li><li><code class="directive"><a href="./mod/core.html#locationmatch"><LocationMatch></a></code></li><li><code class="directive"><a href="./mod/mod_md.html#mdomainsetsection"><MDomainSet></a></code></li><li><code class="directive"><a href="./mod/mod_proxy.html#proxy"><Proxy></a></code></li><li><code class="directive"><a href="./mod/mod_proxy.html#proxymatch"><ProxyMatch></a></code></li><li><code class="directive"><a href="./mod/core.html#virtualhost"><VirtualHost></a></code></li></ul></td></tr></table> + +<p>Il existe deux grands types de conteneurs. La plupart des conteneurs sont +évalués pour chaque requête. Les directives qu'ils contiennent s'appliquent +seulement aux requêtes qui sont concernées par le conteneur. En revanche, +les conteneurs +<code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code>, <code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code>, et +<code class="directive"><a href="./mod/mod_version.html#ifversion"><IfVersion></a></code> sont +évalués seulement au démarrage et au redémarrage du serveur. +Si leurs conditions sont vérifiées au démarrage, les directives qu'ils contiennent +s'appliqueront à toutes les requêtes. Si leurs conditions ne sont pas vérifiées, les +directives qu'ils contiennent seront ignorées.</p> + +<p>Le conteneur <code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code> +contient des directives qui ne seront appliquées que si un paramètre +approprié a été défini dans la ligne de commande de <code class="program"><a href="./programs/httpd.html">httpd</a></code>. +Par exemple, +avec la configuration suivante, toutes les requêtes seront redirigées vers +un autre site si le serveur est démarré en utilisant la ligne de commande : +<code>httpd -DClosedForNow</code>:</p> + +<pre class="prettyprint lang-config"><IfDefine ClosedForNow> + Redirect "/" "http://otherserver.example.com/" +</IfDefine></pre> + + +<p>Le conteneur <code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code> +est similaire; les directives qu'il contient ne s'appliqueront que si +un module particulier est disponible au niveau du serveur. +Le module doit être soit compilé statiquement dans le serveur, soit +dynamiquement et dans ce cas, la ligne <code class="directive"><a href="./mod/mod_so.html#loadmodule">LoadModule</a></code> correspondante doit apparaître +plus haut dans le fichier de configuration. Ce conteneur ne doit être +utilisé que dans le cas où votre fichier de configuration doit fonctionner +indépendamment de la présence ou de l'absence de certains modules. +Il ne doit pas contenir de directives que vous souhaitez voir s'appliquer +systématiquement, car vous pouvez perdre ainsi de précieux messages d'erreur +à propos de modules manquants.</p> + +<p>Dans l'exemple suivant, la directive <code class="directive"><a href="./mod/mod_mime_magic.html#mimemagicfile">MimeMagicFile</a></code> ne s'appliquera que si le +module <code class="module"><a href="./mod/mod_mime_magic.html">mod_mime_magic</a></code> est disponible.</p> + +<pre class="prettyprint lang-config"><IfModule mod_mime_magic.c> + MimeMagicFile "conf/magic" +</IfModule></pre> + + +<p>Le conteneur +<code class="directive"><a href="./mod/mod_version.html#ifversion"><IfVersion></a></code> +est similaire aux conteneurs <code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code> et <code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code>; les directives qu'il contient ne +s'appliqueront que si une version particulière du serveur s'exécute. Ce +conteneur a été conçu pour une utilisation dans les suites de tests +et les grands réseaux qui doivent prendre en compte différentes versions +et configurations de httpd.</p> + +<pre class="prettyprint lang-config"><IfVersion >= 2.4> + # les directives situées ici ne s'appliquent que si la version <br /> + # est supérieure ou égale à 2.4.0. +</IfVersion></pre> + + +<p><code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code>, +<code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code>, et +<code class="directive"><a href="./mod/mod_version.html#ifversion"><IfVersion></a></code> +peuvent inverser leur test conditionnel en le faisant précéder d'un "!". +De plus, ces sections peuvent être imbriquées afin de définir des restrictions +plus complexes.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="file-and-web" id="file-and-web">Système de fichiers, +arborescence du site web et expressions booléennes</a></h2> + +<p>Les conteneurs de sections de configuration les plus couramment utilisés +sont ceux qui modifient la configuration de points particuliers du système de +fichiers ou de l'arborescence du site web. Tout d'abord, il est important de +comprendre la différence entre les deux. Le système de fichiers est une vue +de vos disques tels qu'ils sont perçus par votre système d'exploitation. +Par exemple, avec une installation par défaut, +Apache httpd est situé dans <code>/usr/local/apache2</code> pour le système de +fichiers UNIX, ou <code>"c:/Program Files/Apache Group/Apache2"</code> pour +le système de fichiers Windows. (Notez que des slashes directs doivent +toujours être utilisés comme séparateur de chemin +dans les fichiers de configuration d'Apache httpd, même sous +Windows.) Quant à +l'arborescence du site web, il s'agit d'une vue de votre site +tel que présenté par le +serveur web et perçue par le client. Ainsi le chemin <code>/dir/</code> dans +l'arborescence du site web correspond au chemin +<code>/usr/local/apache2/htdocs/dir/</code> dans le système de fichiers pour +une installation d'Apache httpd par défaut sous UNIX. +En outre, l'arborescence du site web n'a pas besoin de correspondre en permanence au +système de fichiers, car les pages web peuvent être générées dynamiquement +à partir de bases de données ou d'autres emplacements.</p> + +<h3><a name="filesystem" id="filesystem">Conteneurs de système de fichiers</a></h3> + +<p>Les conteneurs <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> +et <code class="directive"><a href="./mod/core.html#files"><Files></a></code>, +ainsi que leurs équivalents acceptant les +<a class="glossarylink" href="./glossary.html#regex" title="voir glossaire">expressions rationnelles</a>, +appliquent des directives à certaines parties du système de fichiers. +Les directives contenues dans une section <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> s'appliquent au répertoire +précisé, ainsi qu'à tous ses sous-répertoires et aux fichiers que ces +derniers contiennent. +Le même effet peut être obtenu en utilisant les <a href="howto/htaccess.html">fichiers .htaccess</a>. Par exemple, avec la +configuration suivante, l'indexation sera activée pour le répertoire +<code>/var/web/dir1</code> et tous ses sous-répertoires.</p> + +<pre class="prettyprint lang-config"><Directory "/var/web/dir1"> + Options +Indexes +</Directory></pre> + + +<p>Les directives contenues dans une section <code class="directive"><a href="./mod/core.html#files"><Files></a></code> s'appliquent à tout fichier +avec le nom spécifié, quel que soit le répertoire dans lequel il se trouve. +Ainsi par exemple, les directives de configuration suivantes, si elles sont +placées dans la section principale du fichier de configuration, vont interdire +l'accès à tout fichier nommé <code>private.html</code> quel que soit +l'endroit où il se trouve.</p> + +<pre class="prettyprint lang-config"><Files "private.html"> + Require all denied +</Files></pre> + + +<p>Pour faire référence à des fichiers qui se trouvent en des points +particuliers du système de fichiers, les sections +<code class="directive"><a href="./mod/core.html#files"><Files></a></code> et +<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> +peuvent être combinées. Par exemple, la configuration suivante va interdire +l'accès à <code>/var/web/dir1/private.html</code>, +<code>/var/web/dir1/subdir2/private.html</code>, +<code>/var/web/dir1/subdir3/private.html</code>, ainsi que toute instance de +<code>private.html</code> qui se trouve dans l'arborescence +<code>/var/web/dir1/</code>.</p> + +<pre class="prettyprint lang-config"><Directory "/var/web/dir1"> + <Files "private.html"> + Require all denied + </Files> +</Directory></pre> + + + +<h3><a name="webspace" id="webspace">Conteneurs de l'arborescence du site web</a></h3> + +<p>le conteneur <code class="directive"><a href="./mod/core.html#location"><Location></a></code> +et son équivalent acceptant les +<a class="glossarylink" href="./glossary.html#regex" title="voir glossaire">expressions rationnelles</a>, modifient quant à eux la +configuration de parties de l'arborescence du site web. Par exemple, la +configuration suivante interdit l'accès à toute URL dont la partie chemin +commence par /private. +En particulier, l'interdiction s'appliquera aux requêtes pour : +<code>http://yoursite.example.com/private</code>, +<code>http://yoursite.example.com/private123</code>, et +<code>http://yoursite.example.com/private/dir/file.html</code> ainsi qu'à +toute requête commençant par la chaîne de caractères <code>/private</code>.</p> + +<pre class="prettyprint lang-config"><LocationMatch "^/private"> + Require all denied +</LocationMatch></pre> + + +<p>Le conteneur <code class="directive"><a href="./mod/core.html#location"><Location></a></code> +n'a pas besoin de faire référence à un élément du système de fichiers. +Par exemple, l'exemple suivant montre comment faire référence à une URL +particulière vers un gestionnaire interne du serveur HTTP Apache fourni par le module +<code class="module"><a href="./mod/mod_status.html">mod_status</a></code>. +Il n'est pas nécessaire de trouver un fichier nommé <code>server-status</code> +dans le système de fichiers.</p> + +<pre class="prettyprint lang-config"><Location "/server-status"> + SetHandler server-status +</Location></pre> + + + +<h3><a name="overlapping-webspace" id="overlapping-webspace">Espace web imbriqué</a></h3> +<p>Pour contrôler deux URLs imbriquées, on doit tenir compte de l'ordre +dans lequel certaines sections ou directives sont évaluées. Pour +<code class="directive"><a href="./mod/core.html#location"><Location></a></code>, on doit +avoir :</p> +<pre class="prettyprint lang-config"><Location "/foo"> +</Location> +<Location "/foo/bar"> +</Location></pre> + +<p>Les directives <code class="directive"><a href="./mod/mod_alias.html#alias"><Alias></a></code>, quant à elles, sont évaluées vice-versa :</p> +<pre class="prettyprint lang-config">Alias "/foo/bar" "/srv/www/uncommon/bar" +Alias "/foo" "/srv/www/common/foo"</pre> + +<p>Ceci est aussi vrai pour les directives <code class="directive"><a href="./mod/mod_proxy.html#proxypass">ProxyPass</a></code> :</p> +<pre class="prettyprint lang-config">ProxyPass "/special-area" "http://special.example.com" smax=5 max=10 +ProxyPass "/" "balancer://mycluster/" stickysession=JSESSIONID|jsessionid nofailover=On</pre> + + + + +<h3><a name="wildcards" id="wildcards">Caractères de remplacement +et expressions rationnelles</a></h3> + +<p>Les conteneurs +<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code>, +<code class="directive"><a href="./mod/core.html#files"><Files></a></code>, et +<code class="directive"><a href="./mod/core.html#location"><Location></a></code> +peuvent utiliser des caractères de remplacement de style shell comme dans +la fonction <code>fnmatch</code> de la bibliothèque C standard. +Le caractère "*" +correspond à toute séquence de caractères, "?" à un caractère seul, +et "[<em>seq</em>]" à tout caractère contenu dans <em>seq</em>. +Le caractère "/" +ne peut pas faire l'objet d'un remplacement; +il doit être spécifié explicitement.</p> + +<p>Si une définition des critères de correspondance +encore plus souple est nécessaire, chaque conteneur +possède son équivalent acceptant les expressions rationnelles : <code class="directive"><a href="./mod/core.html#directorymatch"><DirectoryMatch></a></code>, <code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code>, et <code class="directive"><a href="./mod/core.html#locationmatch"><LocationMatch></a></code> acceptent les +<a class="glossarylink" href="./glossary.html#regex" title="voir glossaire">expressions rationnelles</a> compatibles Perl +pour définir les critères de correspondance. Mais voyez plus loin la section +à propos de la combinaison des sections de configuration +pour comprendre comment l'utilisation de +conteneurs avec des expressions rationnelles va modifier la manière +dont les directives sont appliquées.</p> + +<p>Un conteneur qui modifie la configuration de tous les +répertoires utilisateurs à l'aide de caractères de remplacement +mais sans utiliser +les expressions rationnelles pourrait ressembler à ceci :</p> + +<pre class="prettyprint lang-config"><Directory "/home/*/public_html"> + Options Indexes +</Directory></pre> + + +<p>Avec les conteneurs utilisant les expressions rationnelles, +on peut interdire l'accès à de nombreux types de fichiers d'images +simultanément :</p> +<pre class="prettyprint lang-config">+<FilesMatch "\.(?i:gif|jpe?g|png)$"> + Require all denied +</FilesMatch></pre> + + +<p>Les expressions rationnelles contenant des <strong>groupes nommés et +des références arrières</strong> sont ajoutées à l'environnement avec +leur nom en majuscules. Ceci permet de référencer des éléments de +chemins de fichiers et d'URLs depuis une <a href="expr.html">expression</a> et au sein de modules comme +<code class="module"><a href="./mod/mod_rewrite.html">mod_rewrite</a></code>.</p> + +<pre class="prettyprint lang-config"><DirectoryMatch "^/var/www/combined/(?<SITENAME>[^/]+)"> + Require ldap-group "cn=%{env:MATCH_SITENAME},ou=combined,o=Example" +</DirectoryMatch></pre> + + + + +<h3><a name="expressions" id="expressions">Expressions booléennes</a></h3> +<p>La directive <code class="directive"><a href="./mod/core.html#if"><If></a></code> +permet de modifier la configuration en fonction d'une condition qui peut +être définie sous la forme d'une expression booléenne. Dans l'exemple +suivant, l'accès est interdit si l'en-tête HTTP Referer ne commence pas +par "http://www.example.com/".</p> +<pre class="prettyprint lang-config"><If "!(%{HTTP_REFERER} -strmatch 'http://www.example.com/*')"> + Require all denied +</If></pre> + + + + +<h3><a name="whichwhen" id="whichwhen">Que faut-il utiliser et quand ?</a></h3> + +<p>Choisir entre des conteneurs de système de fichiers et des conteneurs +d'arborescence du site web est vraiment très simple. +Pour appliquer des directives à des objets qui résident dans le système de +fichiers, utilisez toujours un conteneur <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> ou <code class="directive"><a href="./mod/core.html#files"><Files></a></code>. Pour appliquer des directives à des objets +qui ne résident pas dans le système de fichiers (comme une page web générée +par une base de données), utilisez un conteneur <code class="directive"><a href="./mod/core.html#location"><Location></a></code>.</p> + +<p>Il ne faut jamais utiliser un conteneur <code class="directive"><a href="./mod/core.html#location"><Location></a></code> pour restreindre l'accès à des +objets du système de fichiers, car plusieurs localisations de +l'arborescence du site web (URLs) peuvent correspondre à la même localisation +du système de fichier, ce qui peut permettre de contourner vos restrictions. +Par exemple, imaginez la configuration suivante :</p> + +<pre class="prettyprint lang-config"><Location "/dir/"> + Require all denied +</Location></pre> + + +<p>Elle fonctionne correctement si la requête appelle +<code>http://yoursite.example.com/dir/</code>. Mais que va-t-il se passer si +votre système de fichiers est insensible à la casse ? +Votre restriction va pouvoir être tout simplement contournée en envoyant une +requête sur +<code>http://yoursite.example.com/DIR/</code>. Le conteneur <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code>, quant à lui, s'appliquera +à tout contenu servi à partir de cette localisation, +sans tenir compte de la manière dont il est appelé. +(Les liens du système de fichiers constituent une exception. +Le même répertoire peut être placé dans plusieurs parties du système de +fichiers en utilisant des liens symboliques. Le conteneur +<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> va suivre le +lien symbolique sans modifier le nom du chemin. Par conséquent, pour plus de +sécurité, les liens symboliques doivent être désactivés à l'aide de la +directive +<code class="directive"><a href="./mod/core.html#options">Options</a></code> appropriée.)</p> + +<p>Si vous pensez que vous n'êtes pas concerné par ce problème +parceque vous utilisez un système de fichiers sensible à la casse, +gardez à l'esprit qu'il y a de nombreuses autres manières pour faire +correspondre plusieurs localisations de l'arborescence du site web à la même +localisation du système de fichiers. C'est pourquoi vous devez autant que +possible toujours utiliser les conteneurs de système de fichiers. +Il y a cependant une exception à cette règle. Placer des restrictions de +configuration dans un conteneur <code><Location +"/"></code> est tout à fait sans rique car ce conteneur va s'appliquer à +toutes les requêtes sans tenir compte de l'URL spécifique.</p> + + +<h3><a name="nesting" id="nesting">Imbrication des sections</a></h3> + +<p>Certains types de sections peuvent être imbriqués : d'une part, on peut +utiliser les sections <code class="directive"><a href="./mod/core.html#files"><Files></a></code> +à l'intérieur des sections <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code>, d'autre part, on peut utiliser les +directives <code class="directive"><a href="./mod/core.html#if"><If></a></code> à l'intérieur +des sections <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code>, +<code class="directive"><a href="./mod/core.html#location"><Location></a></code> et <code class="directive"><a href="./mod/core.html#files"><Files></a></code> (mais pas à l'intérieur d'une +autre section <code class="directive"><a href="./mod/core.html#if"><If></a></code>). Les +valeurs des expressions rationnelles correspondant aux sections nommées se +comportent de manière identique.</p> + +<p>Les sections imbriquées sont fusionnées après les sections +non-imbriquées de même type.</p> + + + +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="virtualhost" id="virtualhost">Serveurs virtuels</a></h2> + +<p>Le conteneur <code class="directive"><a href="./mod/core.html#virtualhost"><VirtualHost></a></code> +contient des directives qui s'appliquent à des serveurs virtuels spécifiques. +Ceci s'avère utile pour servir les contenus de plusieurs serveurs virtuels à +partir de la même machine, chacun d'entre eux possédant une configuration +différente. Pour de plus amples informations, voir la <a href="vhosts/">Documentation sur les serveurs virtuels</a>.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="proxy" id="proxy">Mandataire</a></h2> + +<p>Les conteneurs +<code class="directive"><a href="./mod/mod_proxy.html#proxy"><Proxy></a></code> +et <code class="directive"><a href="./mod/mod_proxy.html#proxymatch"><ProxyMatch></a></code> +appliquent les directives de configuration qu'ils contiennent uniquement aux +sites qui correspondent à l'URL spécifiée et auxquels on a +accédé via le serveur mandataire du module <code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code>. +Par exemple, la configuration suivante n'autorisera qu'un sous-ensemble de +clients à accéder au site <code>www.example.com</code> en passant par le serveur +mandataire :.</p> + +<pre class="prettyprint lang-config"><Proxy "http://www.example.com/*"> + Require host yournetwork.example.com +</Proxy></pre> + +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="whatwhere" id="whatwhere">Quelles sont les directives autorisées ?</a></h2> + +<p>Pour déterminer quelles sont les directives autorisées pour tel type de +section de configuration, vérifiez le <a href="mod/directive-dict.html#Context">Contexte</a> de la directive. +Tout ce qui est autorisé dans les sections +<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> +l'est aussi d'un point de vue syntaxique dans les sections +<code class="directive"><a href="./mod/core.html#directorymatch"><DirectoryMatch></a></code>, +<code class="directive"><a href="./mod/core.html#files"><Files></a></code>, +<code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code>, +<code class="directive"><a href="./mod/core.html#location"><Location></a></code>, +<code class="directive"><a href="./mod/core.html#locationmatch"><LocationMatch></a></code>, +<code class="directive"><a href="./mod/mod_proxy.html#proxy"><Proxy></a></code>, +et <code class="directive"><a href="./mod/mod_proxy.html#proxymatch"><ProxyMatch></a></code>. +Il y a cependant quelques exceptions :</p> + +<ul> +<li>La directive <code class="directive"><a href="./mod/core.html#allowoverride">AllowOverride</a></code> +ne fonctionne que dans les sections +<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code>.</li> + +<li>Les <code class="directive"><a href="./mod/core.html#options">Options</a></code> <code>FollowSymLinks</code> et +<code>SymLinksIfOwnerMatch</code> ne fonctionnent que dans les sections +<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> ou les fichiers +<code>.htaccess</code>.</li> + +<li>La directive <code class="directive"><a href="./mod/core.html#options">Options</a></code> ne peut pas être +utilisée dans les sections +<code class="directive"><a href="./mod/core.html#files"><Files></a></code> +et <code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code>.</li> +</ul> +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="merging" id="merging">Comment les sections sont combinées entre elles</a></h2> + +<p>Les sections de configuration sont appliquées dans un ordre très particulier. +Il est important de savoir comment cet ordre est défini car il peut avoir +des effets importants sur la manière dont les directives de configuration +sont interprétées.</p> + + <p>L'ordre dans lequel les sections sont appliquées est :</p> + + <ol> + <li> Les sections <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> (à l'exception des + expressions rationnelles) + et les fichiers <code>.htaccess</code> sont appliquées simultanément (avec + la possibilité pour <code>.htaccess</code>, s'il y est autorisé, de + prévaloir sur + <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code>)</li> + + <li>Les sections + <code class="directive"><a href="./mod/core.html#directorymatch"><DirectoryMatch></a></code> + (et <code><Directory "~"></code>)</li> + + <li>Les sections <code class="directive"><a href="./mod/core.html#files"><Files></a></code> et <code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code> sont appliquées + simultanément</li> + + <li>Les sections + <code class="directive"><a href="./mod/core.html#location"><Location></a></code> + et <code class="directive"><a href="./mod/core.html#locationmatch"><LocationMatch></a></code> sont appliquées + simultanément</li> + + <li>Les sections <code class="directive"><a href="./mod/core.html#if"><If></a></code>, + même si elles sont incluses dans un des contextes précédents. + </li> + </ol> + + <p>Quelques remarques importantes :</p> + <ul> + <li>Mises à part les sections <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code>, dans chaque groupe, les sections sont + traitées selon + l'ordre dans lequel elles apparaissent dans les fichiers de configuration. + Par exemple, une requête pour <em>/foo/bar</em> correspondra à + <code><Location "/foo/bar"></code> et <code><Location + "/foo"></code> (dans ce cas le groupe 4) : les deux sections seront + évaluées mais selon l'ordre dans lequel elles apparaissent dans le fichier + de configuration..</li> + <li>Les sections <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> (groupe 1 ci-dessus) + sont traitées dans l'ordre du répertoire le plus court vers le plus long. + Par exemple, <code><Directory "/var/web/dir"></code> sera + traitée avant <code><Directory + "/var/web/dir/subdir"></code>.</li> + <li>Si plusieurs sections <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> s'appliquent au même + répertoire, elles sont traitées selon l'ordre dans lequel elles + apparaissent dans le fichier de configuration.</li> + <li>Les sections de configuration incluses via la directive <code class="directive"><a href="./mod/core.html#include">Include</a></code> sont traitées comme si elles se + trouvaient réellement dans le fichier qui les inclut à la position de la + directive + <code class="directive"><a href="./mod/core.html#include">Include</a></code>.</li> + <li>Les sections situées à l'intérieur de sections <code class="directive"><a href="./mod/core.html#virtualhost"><VirtualHost></a></code> + sont appliquées <em>après</em> les sections correspondantes situées en + dehors de la définition de l'hôte virtuel, ce qui permet à l'hôte virtuel + de prévaloir sur la configuration du serveur principal.</li> + <li>Quand la requête est servie par le module <code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code>, + le conteneur <code class="directive"><a href="./mod/mod_proxy.html#proxy"><Proxy></a></code> + prend la place du conteneur <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> dans l'ordre de traitement.</li> + <li>Il faut être très prudent lorsqu'on mélange des directives de + configuration similaires à l'intérieur et à l'extérieur d'une section + <code class="directive"><a href="./mod/core.html#if"><If></a></code> car leur ordre + d'apparition a de l'importance. A cet effet, l'utilisation explicite de la + directive <code class="directive"><a href="./mod/core.html#else"><Else></a></code> + peut vous y aider. + </li> + <li>Lorsqu'une section <code class="directive"><a href="./mod/core.html#if"><If></a></code> est utilisée dans un fichier <code>.htaccess</code>, les + directives incluses dans un répertoire parent seront fusionnées + <em>après</em> les directives non-incluses dans un sous-répertoire. + </li> + </ul> + + <div class="note"><h3>Note technique</h3> + Une séquence <code><Location></code>/<code><LocationMatch></code> + est réellement traitée juste avant la phase de traduction du nom + (où <code>Aliases</code> et <code>DocumentRoots</code> + sont utilisés pour faire correspondre les URLs aux noms de fichiers). + Les effets de cette séquence disparaissent totalement lorsque + la traduction est terminée. + </div> + +<h3><a name="relationship-module-configuration" id="relationship-module-configuration">Interactions entre +modules et sections de configuration</a></h3> + <p>Une question se pose souvent après avoir lu comment les sections de + configuration sont fusionnées : comment et quand les directives de modules + particuliers comme <code class="module"><a href="./mod/mod_rewrite.html">mod_rewrite</a></code> sont-elles interprétées ? La + réponse n'est pas triviale et nécessite un approfondissement. Chaque module + httpd gère sa propre configuration, et chacune de ses directives dans + httpd.conf définit un élément de configuration dans un contexte particulier. + httpd n'exécute pas une commande au moment où elle est lue.</p> + <p>A l'exécution, le noyau de httpd parcourt les sections de configuration + dans l'ordre décrit ci-dessus afin de déterminer lesquelles s'appliquent à + la requête courante. Lorsqu'une première section s'applique, elle est + considérée comme la configuration courante pour cette requête. Si une + section suivante s'applique aussi, chaque module qui possède des directives + dans chacune de ces sections a la possibilité de fusionner sa configuration + entre ces deux sections. Il en résulte une troisième configuration et le + processus de fusion se poursuit jusqu'à ce que toutes les sections de + configuration aient été évaluées.</p> + <p>Après l'étape précédente, le traitement proprement dit de la requête HTTP + peut commencer : chaque module peut effectuer toute tâche qui lui incombe, + et pour déterminer de quelle manière dont il doit agir, il peut s'appuyer + sur le noyau de httpd pour retrouver sa configuration globale issue de la + fusion précédente.</p> + <p>Un exemple permet de mieux visualiser l'ensemble du processus. La + configuration suivante utilise la directive <code class="directive"><a href="./mod/mod_headers.html#header">Header</a></code> du module + <code class="module"><a href="./mod/mod_headers.html">mod_headers</a></code> pour définir un en-tête HTTP spécifique. Quelle + valeur httpd va-t-il affecter à l'en-tête <code>CustomHeaderName</code> pour + une requête vers <code>/example/index.html</code> ? + </p> + <pre class="prettyprint lang-config"><Directory "/"> + Header set CustomHeaderName one + <FilesMatch ".*"> + Header set CustomHeaderName three + </FilesMatch> +</Directory> + +<Directory "/example"> + Header set CustomHeaderName two +</Directory></pre> + + <ul> + <li><code class="directive">Directory</code> "/" s'applique, et une configuration + initiale est créée qui définit l'en-tête <code>CustomHeaderName</code> + avec la valeur <code>one</code>.</li> + <li><code class="directive">Directory</code> "/example" s'applique, et comme + <code class="module"><a href="./mod/mod_headers.html">mod_headers</a></code> spécifie dans son code que + la valeur d'un en-tête doit être écrasée si ce dernier est défini à + nouveau, une nouvelle configuration est créée qui définit l'en-tête + <code>CustomHeaderName</code> avec la valeur <code>two</code>.</li> + <li><code class="directive">FilesMatch</code> ".*" s'applique, une nouvelle + opportunité de fusion surgit, et l'en-tête <code>CustomHeaderName</code> + est défini à la valeur <code>three</code>.</li> + <li>Finalement, au cours des étapes suivantes du traitement de la + requête HTTP, <code class="module"><a href="./mod/mod_headers.html">mod_headers</a></code> sera sollicité, et il se + basera sur la configuration qui a défini l'en-tête + <code>CustomHeaderName</code> à la valeur <code>three</code>. + <code class="module"><a href="./mod/mod_headers.html">mod_headers</a></code> utilise normalement cette configuration pour + accomplir sa tâche, à savoir définir des en-têtes HTTP. Cela ne veut + cependant pas dire qu'un module ne peut pas effectuer des actions plus + complexes comme désactiver des directives car elle ne sont pas + nécessaires ou obsolètes, etc...</li> + </ul> + + <p>Ceci est aussi vrai pour les fichiers .htaccess car ils possèdent la même + priorité que les sections <code class="directive">Directory</code> dans l'ordre de + fusion. Il faut bien comprendre que les sections de configuration comme + <code class="directive">Directory</code> et <code class="directive">FilesMatch</code> ne + sont pas comparables avec les directives spécifiques de modules comme + <code class="directive"><a href="./mod/mod_headers.html#header">Header</a></code> ou <code class="directive"><a href="./mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> car elles agissent à des + niveaux différents. + </p> + + +<h3><a name="merge-examples" id="merge-examples">Quelques exemples utiles</a></h3> + +<p>Voici un exemple imaginaire qui montre l'ordre de combinaison des sections. +En supposant qu'elles s'appliquent toutes à la requête, les directives de +cet exemple seront appliquées dans l'ordre suivant : A > B > C > D > +E.</p> + +<pre class="prettyprint lang-config"><Location "/"> + E +</Location> + +<Files "f.html"> + D +</Files> + +<VirtualHost *> + <Directory "/a/b"> + B + </Directory> +</VirtualHost> + +<DirectoryMatch "^.*b$"> + C +</DirectoryMatch> + +<Directory "/a/b"> + A +</Directory></pre> + + +<p>Pour un exemple plus concret, considérez ce qui suit. Sans tenir compte +de toute restriction d'accès placée dans les sections <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code>, la section <code class="directive"><a href="./mod/core.html#location"><Location></a></code> sera +évaluée en dernier et permettra un accès au serveur sans aucune restriction. +En d'autres termes, l'ordre de la combinaison des sections est important, +soyez donc prudent !</p> + +<pre class="prettyprint lang-config"><Location "/"> + Require all granted +</Location> + +# Arrghs! Cette section <Directory> n'aura aucun effet +<Directory "/"> + <RequireAll> + Require all granted + Require not host badguy.example.com + </RequireAll> +</Directory></pre> + + + + +</div></div> +<div class="bottomlang"> +<p><span>Langues Disponibles: </span><a href="./en/sections.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="./fr/sections.html" title="Français"> fr </a> | +<a href="./ja/sections.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | +<a href="./ko/sections.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | +<a href="./tr/sections.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> +</div><div class="top"><a href="#page-header"><img src="./images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Commentaires</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Libera.chat, or sent to our <a href="https://httpd.apache.org/lists.html">mailing lists</a>.</div> +<script type="text/javascript"><!--//--><![CDATA[//><!-- +var comments_shortname = 'httpd'; +var comments_identifier = 'http://httpd.apache.org/docs/2.4/sections.html'; +(function(w, d) { + if (w.location.hostname.toLowerCase() == "httpd.apache.org") { + d.write('<div id="comments_thread"><\/div>'); + var s = d.createElement('script'); + s.type = 'text/javascript'; + s.async = true; + s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; + (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); + } + else { + d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); + } +})(window, document); +//--><!]]></script></div><div id="footer"> +<p class="apache">Copyright 2023 The Apache Software Foundation.<br />Autorisé sous <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html">Glossaire</a> | <a href="./sitemap.html">Plan du site</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- +if (typeof(prettyPrint) !== 'undefined') { + prettyPrint(); +} +//--><!]]></script> +</body></html>
\ No newline at end of file diff --git a/docs/manual/sections.html.ja.utf8 b/docs/manual/sections.html.ja.utf8 new file mode 100644 index 0000000..b31177c --- /dev/null +++ b/docs/manual/sections.html.ja.utf8 @@ -0,0 +1,523 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja"><head> +<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> +<!-- + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + This file is generated from xml source: DO NOT EDIT + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + --> +<title>セクションの設定 - Apache HTTP サーバ バージョン 2.4</title> +<link href="./style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> +<link href="./style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> +<link href="./style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="./style/css/prettify.css" /> +<script src="./style/scripts/prettify.min.js" type="text/javascript"> +</script> + +<link href="./images/favicon.ico" rel="shortcut icon" /></head> +<body id="manual-page"><div id="page-header"> +<p class="menu"><a href="./mod/">モジュール</a> | <a href="./mod/directives.html">ディレクティブ</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html">用語</a> | <a href="./sitemap.html">サイトマップ</a></p> +<p class="apache">Apache HTTP サーバ バージョン 2.4</p> +<img alt="" src="./images/feather.png" /></div> +<div class="up"><a href="./"><img title="<-" alt="<-" src="./images/left.gif" /></a></div> +<div id="path"> +<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP サーバ</a> > <a href="http://httpd.apache.org/docs/">ドキュメンテーション</a> > <a href="./">バージョン 2.4</a></div><div id="page-content"><div id="preamble"><h1>セクションの設定</h1> +<div class="toplang"> +<p><span>翻訳済み言語: </span><a href="./en/sections.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="./fr/sections.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | +<a href="./ja/sections.html" title="Japanese"> ja </a> | +<a href="./ko/sections.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | +<a href="./tr/sections.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> +</div> +<div class="outofdate">この日本語訳はすでに古くなっている + 可能性があります。 + 最近更新された内容を見るには英語版をご覧下さい。 + </div> + <p><a href="configuring.html">設定ファイル</a>中のディレクティブは +サーバ全体に適用されたり、特定のディレクトリやファイル、ホスト、URL にのみ +適用されるように制限したりすることができます。この文書は設定用のセクションの +コンテナや <code>.htaccess</code> ファイルを使って他の設定ディレクティブの +スコープを変更する方法を説明します。</p> +</div> +<div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><ul id="toc"><li><img alt="" src="./images/down.gif" /> <a href="#types">設定用セクションコンテナの種類</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#file-and-web">ファイルシステムとウェブ空間</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#virtualhost">バーチャルホスト</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#proxy">プロクシ</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#whatwhere">どのディレクティブが使えるの?</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#mergin">セクションのマージ方法</a></li> +</ul><h3>参照</h3><ul class="seealso"><li><a href="#comments_section">コメント</a></li></ul></div> +<div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="types" id="types">設定用セクションコンテナの種類</a></h2> + +<table class="related"><tr><th>関連モジュール</th><th>関連ディレクティブ</th></tr><tr><td><ul><li><code class="module"><a href="./mod/core.html">core</a></code></li><li><code class="module"><a href="./mod/mod_version.html">mod_version</a></code></li><li><code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code></li></ul></td><td><ul><li><code class="directive"><a href="./mod/core.html#directory"><Directory></a></code></li><li><code class="directive"><a href="./mod/core.html#directorymatch"><DirectoryMatch></a></code></li><li><code class="directive"><a href="./mod/core.html#files"><Files></a></code></li><li><code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code></li><li><code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code></li><li><code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code></li><li><code class="directive"><a href="./mod/mod_version.html#ifversion"><IfVersion></a></code></li><li><code class="directive"><a href="./mod/core.html#location"><Location></a></code></li><li><code class="directive"><a href="./mod/core.html#locationmatch"><LocationMatch></a></code></li><li><code class="directive"><a href="./mod/mod_proxy.html#proxy"><Proxy></a></code></li><li><code class="directive"><a href="./mod/mod_proxy.html#proxymatch"><ProxyMatch></a></code></li><li><code class="directive"><a href="./mod/core.html#virtualhost"><VirtualHost></a></code></li></ul></td></tr></table> + +<p>コンテナには二つの基本となる種類があります。ほとんどのコンテナは +各リクエストに対して評価されます。その場合、コンテナ中のディレクティブは +コンテナにマッチするリクエストにのみ適用されます。一方、 +<code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code>, +<code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code>, +<code class="directive"><a href="./mod/mod_version.html#ifversion"><IfVersion></a></code> +コンテナは +サーバの起動時と再起動時にのみ評価されます。起動時に条件が真であれば、 +コンテナ中のディレクティブはすべてのリクエストに適用されます。条件が +偽であれば、コンテナ中のディレクティブは無視されます。</p> + +<p><code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code> ディレクティブは +<code class="program"><a href="./programs/httpd.html">httpd</a></code> コマンドラインで適切なパラメータが定義されたときにのみ +適用されるディレクティブを囲います。例えば次の設定では、サーバが +<code>httpd -DClosedForNow</code> を使って起動されたときだけすべての +リクエストを別のサイトにリダイレクトします:</p> + +<div class="example"><p><code> +<IfDefine ClosedForNow><br /> +Redirect / http://otherserver.example.com/<br /> +</IfDefine> +</code></p></div> + +<p><code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code> は +非常に似ていますが、代わりにサーバ上でモジュールが使用可能な場合にのみ +適用可能なディレクティブを囲います。モジュールはサーバに +静的に組み込まれているか、動的に組み込むようになっていて、設定ファイル中で +<code class="directive"><a href="./mod/mod_so.html#loadmodule">LoadModule</a></code> の行がより前の +部分に書かれている必要があります。このディレクティブは特定のモジュールの +存在に関わらず設定ファイルが動作する必要がある場合にのみ使ってください。 +常に動作して欲しいディレクティブを囲むために使うべきではありません。 +存在しないモジュールに関する有用なエラーメッセージの発生を抑制してしまいますので。 +</p> + +<p>次の例では、<code class="module"><a href="./mod/mod_mime_magic.html">mod_mime_magic</a></code> があるときにのみ <code class="directive"><a href="./mod/mod_mime_magic.html#mimemagicfiles">MimeMagicFiles</a></code> ディレクティブが +適用されます。</p> + +<div class="example"><p><code> +<IfModule mod_mime_magic.c><br /> +MimeMagicFile conf/magic<br /> +</IfModule> +</code></p></div> + +<p><code class="directive"><a href="./mod/mod_version.html#ifversion"><IfVersion></a></code> +ディレクティブは +<code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code> や +<code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code>と、 +とてもよく似ていますが、稼働中のサーバのバージョンが特定のバージョンの時にのみ +適用されます。様々なバージョンの httpd を様々な設定で動作させることになる場合で、 +テストスイートや巨大なネットワークでの用途を想定して、 +このモジュールは設計されています。</p> + +<div class="example"><p><code> + <IfVersion >= 2.1><br /> + <span class="indent"> + # this happens only in versions greater or<br /> + # equal 2.1.0.<br /> + </span> + </IfVersion> +</code></p></div> + +<p><code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code>, +<code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code>, +<code class="directive"><a href="./mod/mod_version.html#ifversion"><IfVersion></a></code> ディレクティブは +テストの前に "!" を付けることで否定の条件を適用することができます。 +また、これらのセクションはより複雑な制限を課すために入れ子にすることができます。 +</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="file-and-web" id="file-and-web">ファイルシステムとウェブ空間</a></h2> + +<p>最もよく使われる設定のセクションコンテナはファイルシステムやウェブ空間の +特定の場所の設定を変更するものです。まず、この二つの違いを理解することが +大切です。ファイルシステムはオペレーティングシステムから見たディスクの内容です。 +たとえば、デフォルトのインストールでは Apache は Unix ファイルシステムでは +<code>/usr/local/apache2</code> に、Windows ファイルシステムでは +<code>"c:/Program Files/Apache Group/Apache2"</code> に存在します。 +(Apache では Windows でもパスセパレータとしてスラッシュを使うことに +気をつけてください。) 対照的に、ウェブ空間はあなたのサイトを +ウェブサーバから配信されるものとして見たもので、クライアントに見えるものです。 +デフォルトの Unix 上の Apache のインストールではウェブ空間の +<code>/dir/</code> というパスはファイルシステムの +<code>/usr/local/apache2/htdocs/dir/</code> というパスに対応します。 +ウェブページはデータベースや他の場所から動的に生成することもできますので、 +ウェブ空間はファイルシステムに直接マップする必要はありません。</p> + +<h3><a name="filesystem" id="filesystem">ファイルシステムコンテナ</a></h3> + +<p><code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> ディレクティブと +<code class="directive"><a href="./mod/core.html#files"><Files></a></code> ディレクティブ、それと +それらの正規表現版はディレクティブをファイルシステムの一部分に対して適用します。 +<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> セクションの +中のディレクティブは指定されたディレクトリとそのすべてのサブディレクトリに +適用されます。<a href="howto/htaccess.html">.htaccess ファイル</a>を +使うことでも同じ効果を得ることができます。例えば、次の設定では +<code>/var/web/dir1</code> とすべてのサブディレクトリに対して +ディレクトリインデックスを行ないます。</p> + +<div class="example"><p><code> +<Directory /var/web/dir1><br /> +Options +Indexes<br /> +</Directory> +</code></p></div> + +<p><code class="directive"><a href="./mod/core.html#files"><Files></a></code> セクションの +中にあるディレクティブはどのディレクトリにあるかに関わらず、指定された名前の +すべてのファイルに適用されます。ですから例えば以下の設定ディレクティブが +設定ファイルの主セクションに書かれたときには、すべての場所の +<code>private.html</code> という名前のファイルへのアクセスを拒否します。</p> + +<div class="example"><p><code> +<Files private.html><br /> +Order allow,deny<br /> +Deny from all<br /> +</Files> +</code></p></div> + +<p>ファイルシステムの特定の場所にあるファイルを指定するために、 +<code class="directive"><a href="./mod/core.html#files"><Files></a></code> セクションと +<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> セクションを +組み合わせることができます。例えば、次の設定では +<code>/var/web/dir1/private.html</code>, +<code>/var/web/dir1/subdir2/private.html</code>, +<code>/var/web/dir1/subdir3/private.html</code> など、 +<code>/var/web/dir1/</code> ディレクトリの下にあるすべての +<code>private.html</code> へのアクセスを拒否します。</p> + +<div class="example"><p><code> +<Directory /var/web/dir1><br /> +<Files private.html><br /> +Order allow,deny<br /> +Deny from all<br /> +</Files><br /> +</Directory> +</code></p></div> + + +<h3><a name="webspace" id="webspace">ウェブ空間コンテナ</a></h3> + +<p>一方、<code class="directive"><a href="./mod/core.html#location"><Location></a></code> +ディレクティブとその<a class="glossarylink" href="./glossary.html#regex" title="用語集を参照">正規表現</a>版は +ウェブ空間上の内容に対して設定を変更します。 +たとえば、次の設定では /private で始まる URL パスへのアクセスを制限します。 +具体的には、 +<code>http://yoursite.example.com/private</code>, +<code>http://yoursite.example.com/private123</code>, +<code>http://yoursite.example.com/private/dir/file.html</code> +へのリクエストや、 +他の同様に <code>/private</code> 文字列で始まるリクエストに +適用されます。</p> + +<div class="example"><p><code> +<Location /private><br /> +Order Allow,Deny<br /> +Deny from all<br /> +</Location> +</code></p></div> + +<p><code class="directive"><a href="./mod/core.html#location"><Location></a></code> +ディレクティブはファイルシステムと関係ある必要が全くありません。 +たとえば次の例では、どのようにして特定の URL を +<code class="module"><a href="./mod/mod_status.html">mod_status</a></code>で提供されている Apache +内部ハンドラにマップするかを示しています。ファイルシステムに +<code>server-status</code> というファイルが存在する必要はありません。</p> + +<div class="example"><p><code> +<Location /server-status><br /> +SetHandler server-status<br /> +</Location> +</code></p></div> + + +<h3><a name="wildcards" id="wildcards">ワイルドカードと正規表現</a></h3> + +<p><code class="directive"><a href="./mod/core.html#directory"><Directory></a></code>, +<code class="directive"><a href="./mod/core.html#files"><Files></a></code>, +<code class="directive"><a href="./mod/core.html#location"><Location></a></code> +ディレクティブでは、 C 標準ライブラリの <code>fnmatch</code> のように +shell スタイルのワイルドカードキャラクタが使用できます。 +"*" 文字は任意の文字列にマッチし、"?" 文字は任意の 1 文字にマッチし、 +"[<em>seq</em>]" は <em>seq</em> の任意の文字にマッチします。 +"/" 文字はどのワイルドカードでもマッチされません。 +明示的に指定する必要があります。</p> + +<p>これより柔軟なマッチングが必要な場合は、これらのコンテナに正規表現 +(regex) 版である +<code class="directive"><a href="./mod/core.html#directorymatch"><DirectoryMatch></a></code>, +<code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code>, +<code class="directive"><a href="./mod/core.html#locationmatch"><LocationMatch></a></code> +があり、マッチを選択するのに perl 互換<a class="glossarylink" href="./glossary.html#regex" title="用語集を参照">正規表現</a>を使用できます。しかし、次の設定のマージに目を通して、 +regex セクションを使用することで、ディレクティブの適用がどのように +変化するか把握しておいてください。</p> + +<p>全ユーザディレクトリの設定を変更する、非 regex +ワイルドカードセクションは次のようになります。</p> + +<div class="example"><p><code> +<Directory /home/*/public_html><br /> +Options Indexes<br /> +</Directory> +</code></p></div> + +<p>regex セクションを使用することで、画像ファイルの多くのタイプに対する +アクセスを一度に拒否できます。</p> +<div class="example"><p><code> +<FilesMatch \.(?i:gif|jpe?g|png)$><br /> +Order allow,deny<br /> +Deny from all<br /> +</FilesMatch> +</code></p></div> + + + +<h3><a name="whichwhen" id="whichwhen">いつ何を使うか</a></h3> + +<p>ファイルシステムコンテナとウェブ空間コンテナを使い分けるのは、 +実際には非常に簡単です。ファイルシステムに依存する +オブジェクトにディレクティブを適応する場合は、必ず +<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> か +<code class="directive"><a href="./mod/core.html#files"><Files></a></code> +を使用します。ファイルシステムに依存しないオブジェクト +(データベースから生成されるウェブページなど) +にディレクティブを適用する際には、 +<code class="directive"><a href="./mod/core.html#location"><Location></a></code> +を使用します。</p> + +<p>ファイルシステム上のオブジェクトへのアクセスを制限するために、 +<code class="directive"><a href="./mod/core.html#location"><Location></a></code> +を決して使用ないようにしましょう。 +同一のファイルシステム位置にマップしている、ウェブ空間位置 (URL) +が多数あって、設定した制限を迂回されてしまうかもしれないからです。 +例えば次の設定を考えてみましょう。</p> + +<div class="example"><p><code> +<Location /dir/><br /> +Order allow,deny<br /> +Deny from all<br /> +</Location> +</code></p></div> + +<p><code>http://yoursite.example.com/dir/</code> +へのリクエストでは上手く動作します。しかし大文字小文字を区別しない +ファイルシステムを使っていたらどうなるでしょう? +<code>http://yoursite.example.com/DIR/</code> +へのリクエストで簡単にアクセス制限を迂回されてしまいます。これに対して +<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> +ディレクティブを使用すると、どのように呼び出されたかに関わらず +その場所から提供される内容に適用されます。 +(例外はファイルシステムのリンクです。シンボリックリンクを使って、 +同一のディレクトリを複数のファイルシステムに設置できます。 +<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> +ディレクティブはパス名をリセットすることなくシンボリックリンクを +辿ります。ですから、高度なセキュリティが要求される場合は、 +適切に <code class="directive"><a href="./mod/core.html#options">Options</a></code> +ディレクティブを使用してシンボリックリンクを無効にするべきです。)</p> + +<p>大文字小文字を区別するファイルシステムを使用しているから上記のことは +無関係だと思われるかもしれませんが、 +同一のファイルシステム位置に複数のウェブ空間位置をマップする方法は、 +他にいくらでもあるということを覚えていてください。 +ですからできる限りファイルシステムコンテナを使用してください。 +しかしながら一つだけ例外があります。 +<code><Location /></code> セクションはどんな URL +にも関わらず適用されるので、完全に安全です。</p> + + +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="virtualhost" id="virtualhost">バーチャルホスト</a></h2> + +<p><code class="directive"><a href="./mod/core.html#virtualhost"><VirtualHost></a></code> +コンテナは特定のホストに適用するディレクティブを格納します。 +一台のマシンで複数のホストを異なる設定で提供したいときに有用です。 +詳細に関しては<a href="vhosts/">バーチャルホストドキュメント</a>を +ご覧下さい。</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="proxy" id="proxy">プロクシ</a></h2> + +<p><code class="directive"><a href="./mod/mod_proxy.html#proxy"><Proxy></a></code> +と <code class="directive"><a href="./mod/mod_proxy.html#proxymatch"><ProxyMatch></a></code> +コンテナは、特定の URL にマッチする <code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code> +プロクシサーバを経由してアクセスしたサイトに対してのみ適用される +設定ディレクティブを格納します。例えば次の設定は、<code>cnn.com</code> +ウェブサイトにアクセスするために用いられるプロクシサーバを +制限します。</p> + +<div class="example"><p><code> +<Proxy http://cnn.com/*><br /> +Order allow,deny<br /> +Deny from all<br /> +</Proxy> +</code></p></div> +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="whatwhere" id="whatwhere">どのディレクティブが使えるの?</a></h2> + +<p>どのタイプの設定セクションでどのディレクティブが使用できるかは、 +ディレクティブの <a href="mod/directive-dict.html#Context">Context</a> +を見てください。 +<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> +で使用可能なものは全て、同様に +<code class="directive"><a href="./mod/core.html#directorymatch"><DirectoryMatch></a></code>, +<code class="directive"><a href="./mod/core.html#files"><Files></a></code>, +<code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code>, +<code class="directive"><a href="./mod/core.html#location"><Location></a></code>, +<code class="directive"><a href="./mod/core.html#locationmatch"><LocationMatch></a></code>, +<code class="directive"><a href="./mod/mod_proxy.html#proxy"><Proxy></a></code>, +<code class="directive"><a href="./mod/mod_proxy.html#proxymatch"><ProxyMatch></a></code> +セクションで使用可能です。しかしながら幾つか例外も存在します。</p> + +<ul> +<li><code class="directive"><a href="./mod/core.html#allowoverride">AllowOverride</a></code> ディレクティブは +<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> +セクションでのみ使用可能です。</li> + +<li><code>FollowSymLinks</code> と <code>SymLinksIfOwnerMatch</code> の +<code class="directive"><a href="./mod/core.html#options">Options</a></code> は、 +<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> +セクションか <code>.htaccess</code> ファイルでのみ使用可能です。</li> + +<li><code class="directive"><a href="./mod/core.html#options">Options</a></code> ディレクティブは、 +<code class="directive"><a href="./mod/core.html#files"><Files></a></code> +と <code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code> +セクションでは使用できません。</li> +</ul> +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="mergin" id="mergin">セクションのマージ方法</a></h2> + + <p>マージの順番は以下のようになっています:</p> + + <ol> + <li><code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> (正規表現無し) と + <code>.htaccess</code> を同時に (<code>.htaccess</code> が許可されていれば、それが + <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> を上書きします) + </li> + + <li><code class="directive"><a href="./mod/core.html#directorymatch"><DirectoryMatch></a></code> + (と <code><Directory ~></code></li> + + <li><code class="directive"><a href="./mod/core.html#files"><Files></a></code> と + <code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code> を同時に</li> + + <li><code class="directive"><a href="./mod/core.html#location"><Location></a></code> と + <code class="directive"><a href="./mod/core.html#locationmatch"><LocationMatch></a></code> を同時に</li> + </ol> + + <p><code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> + 以外は、それぞれのグループは設定ファイルに現れた順番に処理されます。 + <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> (上のグループ 1) + はディレクトリが短いものから長いものへと処理されます。ですから、 + 例えば <code><Directory /var/web/dir1></code> は + <code><Directory /var/web/dir/subdir></code> の前に処理されます。複数の + <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> セクションが + 同じディレクトリに + 適用される場合は、設定ファイル中の順番に従って処理されます。 + <code class="directive"><a href="./mod/core.html#include">Include</a></code> + によって挿入された設定は 挿入しているファイルの + <code class="directive"><a href="./mod/core.html#include">Include</a></code> + ディレクティブの位置にあったかのように扱われます。</p> + + <p><code class="directive"><a href="./mod/core.html#virtualhost"><VirtualHost></a></code> セクション中のセクションは + バーチャルホストの定義の外側の対応するセクションの + <em>後</em>に適用されます。これによりバーチャルホストが + メインのサーバ設定を上書きできるようなります。</p> + + <p><code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code> でリクエストが処理される場合は、 + 処理順番のうち、<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> コンテナの部分が + <code class="directive"><a href="./mod/mod_proxy.html#proxy"><Proxy></a></code> + コンテナに取って代わられます。</p> + + <p>後のセクションのディレクティブが前のセクションのものを上書きします。</p> + + +<div class="note"><h3>技術メモ</h3> + 実際には、名前を変換する段階 (URL + をファイル名にマップするために <code>Alias</code> や + <code>DocumentRoot</code> が使用されるところ) の直前に + <code class="directive"><a href="./mod/core.html#location"><Location></a></code>/<code class="directive"><a href="./mod/core.html#locationmatch"><LocationMatch></a></code> + が行なわれます。 + これらを適用した結果は変換が終わった後に完全に捨てられます。 +</div> +<h3><a name="merge-examples" id="merge-examples">例</a></h3> + +<p>次はマージの順番を示すための恣意的な例になっています。 +リクエスト全てに適用されるとして、本例のディレクティブは +A > B > C > D > E の順番に適用されます。</p> + +<div class="example"><p><code> +<Location /><br /> +E<br /> +</Location><br /> +<br /> +<Files f.html><br /> +D<br /> +</Files><br /> +<br /> +<VirtualHost *><br /> +<Directory /a/b><br /> +B<br /> +</Directory><br /> +</VirtualHost><br /> +<br /> +<DirectoryMatch "^.*b$"><br /> +C<br /> +</DirectoryMatch><br /> +<br /> +<Directory /a/b><br /> +A<br /> +</Directory><br /> +<br /> +</code></p></div> + +<p>もっと具体的な、次の例を考えてみましょう。 +<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> +セクションに設置されたアクセス制限に関わらず、 +<code class="directive"><a href="./mod/core.html#location"><Location></a></code> +セクションが最後に評価されて、サーバへのアクセスは制限されません。 +言い換えれば、マージの順番は重要で、注意して使用してください!</p> + +<div class="example"><p><code> +<Location /><br /> +Order deny,allow<br /> +Allow from all<br /> +</Location><br /> +<br /> +# Woops! This <Directory> section will have no effect<br /> +<Directory /><br /> +Order allow,deny<br /> +Allow from all<br /> +Deny from badguy.example.com<br /> +</Directory> +</code></p></div> + + + +</div></div> +<div class="bottomlang"> +<p><span>翻訳済み言語: </span><a href="./en/sections.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="./fr/sections.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | +<a href="./ja/sections.html" title="Japanese"> ja </a> | +<a href="./ko/sections.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | +<a href="./tr/sections.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> +</div><div class="top"><a href="#page-header"><img src="./images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">コメント</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Libera.chat, or sent to our <a href="https://httpd.apache.org/lists.html">mailing lists</a>.</div> +<script type="text/javascript"><!--//--><![CDATA[//><!-- +var comments_shortname = 'httpd'; +var comments_identifier = 'http://httpd.apache.org/docs/2.4/sections.html'; +(function(w, d) { + if (w.location.hostname.toLowerCase() == "httpd.apache.org") { + d.write('<div id="comments_thread"><\/div>'); + var s = d.createElement('script'); + s.type = 'text/javascript'; + s.async = true; + s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; + (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); + } + else { + d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); + } +})(window, document); +//--><!]]></script></div><div id="footer"> +<p class="apache">Copyright 2023 The Apache Software Foundation.<br />この文書は <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> のライセンスで提供されています。.</p> +<p class="menu"><a href="./mod/">モジュール</a> | <a href="./mod/directives.html">ディレクティブ</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html">用語</a> | <a href="./sitemap.html">サイトマップ</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- +if (typeof(prettyPrint) !== 'undefined') { + prettyPrint(); +} +//--><!]]></script> +</body></html>
\ No newline at end of file diff --git a/docs/manual/sections.html.ko.euc-kr b/docs/manual/sections.html.ko.euc-kr new file mode 100644 index 0000000..650c74a --- /dev/null +++ b/docs/manual/sections.html.ko.euc-kr @@ -0,0 +1,452 @@ +<?xml version="1.0" encoding="EUC-KR"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="ko" xml:lang="ko"><head> +<meta content="text/html; charset=EUC-KR" http-equiv="Content-Type" /> +<!-- + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + This file is generated from xml source: DO NOT EDIT + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + --> +<title> - Apache HTTP Server Version 2.4</title> +<link href="./style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> +<link href="./style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> +<link href="./style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="./style/css/prettify.css" /> +<script src="./style/scripts/prettify.min.js" type="text/javascript"> +</script> + +<link href="./images/favicon.ico" rel="shortcut icon" /></head> +<body id="manual-page"><div id="page-header"> +<p class="menu"><a href="./mod/"></a> | <a href="./mod/directives.html">þ</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html"></a> | <a href="./sitemap.html">Ʈ</a></p> +<p class="apache">Apache HTTP Server Version 2.4</p> +<img alt="" src="./images/feather.png" /></div> +<div class="up"><a href="./"><img title="<-" alt="<-" src="./images/left.gif" /></a></div> +<div id="path"> +<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="./">Version 2.4</a></div><div id="page-content"><div id="preamble"><h1> </h1> +<div class="toplang"> +<p><span> : </span><a href="./en/sections.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="./fr/sections.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | +<a href="./ja/sections.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | +<a href="./ko/sections.html" title="Korean"> ko </a> | +<a href="./tr/sections.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> +</div> +<div class="outofdate"> ֽ ƴմϴ. + ֱٿ ϼ.</div> + <p><a href="configuring.html"></a> ִ +þ ü ǰų, Ư 丮, , ȣƮ, +URL ִ. ٸ þ +ϱ ̳ <code>.htaccess</code> +ϴ Ѵ.</p> +</div> +<div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><ul id="toc"><li><img alt="" src="./images/down.gif" /> <a href="#types"> </a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#file-and-web">Ͻý۰ </a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#virtualhost">ȣƮ</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#proxy">Ͻ</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#whatwhere">ȿ þ +ֳ?</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#mergin">ǵ ϴ </a></li> +</ul><h3></h3><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div> +<div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="types" id="types"> </a></h2> + +<table class="related"><tr><th>õ </th><th>õ þ</th></tr><tr><td><ul><li><code class="module"><a href="./mod/core.html">core</a></code></li><li><code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code></li></ul></td><td><ul><li><code class="directive"><a href="./mod/core.html#directory"><Directory></a></code></li><li><code class="directive"><a href="./mod/core.html#directorymatch"><DirectoryMatch></a></code></li><li><code class="directive"><a href="./mod/core.html#files"><Files></a></code></li><li><code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code></li><li><code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code></li><li><code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code></li><li><code class="directive"><a href="./mod/core.html#location"><Location></a></code></li><li><code class="directive"><a href="./mod/core.html#locationmatch"><LocationMatch></a></code></li><li><code class="directive"><a href="./mod/mod_proxy.html#proxy"><Proxy></a></code></li><li><code class="directive"><a href="./mod/mod_proxy.html#proxymatch"><ProxyMatch></a></code></li><li><code class="directive"><a href="./mod/core.html#virtualhost"><VirtualHost></a></code></li></ul></td></tr></table> + +<p>ǿ ΰ ִ. κ ſû óȴ. +شϴ û ȿ þ Ѵ. ݴ, <code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code> <code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code> +Ҷ óѴ. Ҷ ° ̸ ȿ ִ +þ û ȴ. ƴϸ ȿ ִ þ +Ѵ.</p> + +<p><code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code> +þ <code>httpd</code> ĶͰ ִ +쿡 ȿ þ Ѵ. , + <code>httpd -DClosedForNow</code> 쿡 + û ٸ Ʈ ̷ǵȴ:</p> + +<div class="example"><p><code> +<IfDefine ClosedForNow><br /> +Redirect / http://otherserver.example.com/<br /> +</IfDefine> +</code></p></div> + +<p><code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code> +þ Ư Ե 쿡 ȿ þ +Ѵٴ ϰ ſ ϴ. +ϰų տ <code class="directive"><a href="./mod/mod_so.html#loadmodule">LoadModule</a></code> ־ Ѵ. +þ Ư ġ ٸ ʿ䰡 + ؾ Ѵ. + ֱ ϱ ϴ þ ȿ θ ȵȴ.</p> + +<p> <code class="module"><a href="./mod/mod_mime_magic.html">mod_mime_magic</a></code> <code class="directive"><a href="./mod/mod_mime_magic.html#mimemagicfiles">MimeMagicFiles</a></code> þ +óѴ.</p> + +<div class="example"><p><code> +<IfModule mod_mime_magic.c><br /> +MimeMagicFile conf/magic<br /> +</IfModule> +</code></p></div> + +<p><code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code> +<code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code> +˻ տ "!" ٿ ִ. , ǵ +ļ Ͽ ȿ ִ.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="file-and-web" id="file-and-web">Ͻý۰ </a></h2> + +<p> Ǵ Ͻý۰ (webspace) +Ư ҿ ϴ ͵̴. ̸ +ϴ ߿ϴ. Ͻý ü 忡 ũ + ̴. , ⺻ ġ ġ ϸ н +Ͻý <code>/usr/local/apache2</code>, +Ͻý <code>"c:/Program Files/Apache +Group/Apache2"</code> ġȴ. (ġ +, ƴ, ϶.) ݴ + ϰ Ŭ̾Ʈ Ե Ʈ ̴. + н ⺻ ġ ġ +<code>/dir/</code> Ͻý +<code>/usr/local/apache2/htdocs/dir/</code> شѴ. +Ÿ̽ ֱ ݵ +Ͻýۿ ʿ .</p> + +<h3><a name="filesystem" id="filesystem">Ͻý </a></h3> + +<p><code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> +<code class="directive"><a href="./mod/core.html#files"><Files></a></code> þ +ǥ ϴ þ Ͻý Ư κп þ +Ѵ. <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> þ Ե þ + Ͻý 丮 丮 ȴ. <a href="howto/htaccess.html">.htaccess </a> ص +. , 丮 (index) +<code>/var/web/dir1</code> 丮 丮 (index) +ϴ.</p> + +<div class="example"><p><code> +<Directory /var/web/dir1><br /> +Options +Indexes<br /> +</Directory> +</code></p></div> + +<p><code class="directive"><a href="./mod/core.html#files"><Files></a></code> ǿ Ե þ +丮 ִ ̸ Ͽ ȴ. + ּκп ִ , ҿ + <code>private.html</code>̶ ̸ +źѴ.</p> + +<div class="example"><p><code> +<Files private.html><br /> +Order allow,deny<br /> +Deny from all<br /> +</Files> +</code></p></div> + +<p>Ͻý Ư κп ִ Īϱ <code class="directive"><a href="./mod/core.html#files"><Files></a></code> <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> +Ѵ. , +<code>/var/web/dir1/private.html</code>, +<code>/var/web/dir1/subdir2/private.html</code>, +<code>/var/web/dir1/subdir3/private.html</code> +<code>/var/web/dir1/</code> 丮 Ʒ ִ ̸ +<code>private.html</code> źѴ.</p> + +<div class="example"><p><code> +<Directory /var/web/dir1><br /> +<Files private.html><br /> +Order allow,deny<br /> +Deny from all<br /> +</Files><br /> +</Directory> +</code></p></div> + + +<h3><a name="webspace" id="webspace"> </a></h3> + +<p><code class="directive"><a href="./mod/core.html#location"><Location></a></code> +þ ̿ شϴ ǥ ϴ þ ݴ +Ư ٲ۴. , /private +ϴ URL- źεȴ. +<code>http://yoursite.example.com/private</code>, +<code>http://yoursite.example.com/private123</code>, +<code>http://yoursite.example.com/private/dir/file.html</code> + <code>/private</code> ڿ ϴ û شȴ.</p> + +<div class="example"><p><code> +<Location /private><br /> +Order Allow,Deny<br /> +Deny from all<br /> +</Location> +</code></p></div> + +<p><code class="directive"><a href="./mod/core.html#location"><Location></a></code> +þ Ͻýۿ ʿ䰡 . Ư +URL <code class="module"><a href="./mod/mod_status.html">mod_status</a></code> ϴ ġ ڵ鷯 +Ű ش. Ͻýۿ <code>server-status</code> + ʿ.</p> + +<div class="example"><p><code> +<Location /server-status><br /> +SetHandler server-status<br /> +</Location> +</code></p></div> + + +<h3><a name="wildcards" id="wildcards">ϵī ǥ</a></h3> + +<p><code class="directive"><a href="./mod/core.html#directory"><Directory></a></code>, +<code class="directive"><a href="./mod/core.html#files"><Files></a></code>, +<code class="directive"><a href="./mod/core.html#location"><Location></a></code> +þ C ǥ ̺귯 <code>fnmatch</code> + ϴ ϵī ڸ ִ. +"*" ڴ ڿ̶ Ÿ, "?" ڴ Ѱ +Ÿ, "[<em>seq</em>]" <em>seq</em> ߿ ڸ Ÿ. + ϵī嵵 "/" ڸ Ÿ Ѵ. ڴ + ؾ Ѵ.</p> + +<p> ʿϸ perlȣȯ <a href="glossary.html#regex">ǥ</a> ϴ <code class="directive"><a href="./mod/core.html#directorymatch"><DirectoryMatch></a></code>, <code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code>, <code class="directive"><a href="./mod/core.html#locationmatch"><LocationMatch></a></code> + ִ. Ʒ տ ǥ +ϸ þ Ǵ ϴ .</p> + +<p> 丮 ϴ ǥ ϵī + :</p> + +<div class="example"><p><code> +<Directory /home/*/public_html><br /> +Options Indexes<br /> +</Directory> +</code></p></div> + +<p>ǥ Ͽ ѹ Ͽ + ź ִ:</p> +<div class="example"><p><code> +<FilesMatch \.(?i:gif|jpe?g|png)$><br /> +Order allow,deny<br /> +Deny from all<br /> +</FilesMatch> +</code></p></div> + + + +<h3><a name="whichwhen" id="whichwhen"> ϳ</a></h3> + +<p>Ͻý ǰ ϳ ϴ +ſ . Ͻýۿ ִ ü þ Ҷ +<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> +<code class="directive"><a href="./mod/core.html#files"><Files></a></code> +Ѵ. (Ÿ̽ ) Ͻýۿ + ʴ ü þ Ҷ <code class="directive"><a href="./mod/core.html#location"><Location></a></code> Ѵ.</p> + +<p>Ͻýۿ ִ ü ϱ <code class="directive"><a href="./mod/core.html#location"><Location></a></code> ϸ + ȵȴ. ٸ (URL) Ͻý ҿ + Ƿ, ɾ ȸ ֱ ̴. + 캸:</p> + +<div class="example"><p><code> +<Location /dir/><br /> +Order allow,deny<br /> +Deny from all<br /> +</Location> +</code></p></div> + +<p> <code>http://yoursite.example.com/dir/</code> +ûѴٸ ۵Ѵ. ҹڸ ʴ Ͻý +Ѵٸ Եdz? +<code>http://yoursite.example.com/DIR/</code> ûϿ + ȸ ִ. ݴ <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> þ ûϿ + ҿ Ǵ 뿡 ȴ. (ܴ Ͻý +ũ ϴ . ɺũ Ͽ 丮 +Ͻý ҿ ִ. <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> þ ɺũ . +Ƿ ؼ <code class="directive"><a href="./mod/core.html#options">Options</a></code> þ Ͽ ɺũ +ؾ Ѵ.)</p> + +<p>Ƹ ҹڸ ϴ Ͻý ϹǷ +̷ Ͼ ʴ´ٰ . ٸ +ε ġ Ͻý ġ + ϶. ϸ Ͻý ؾ +Ѵ. Ģ ܰ ϳ ִ. +<code><Location /></code> ǿ θ Ư +URL ƴ û ǹǷ Ϻϰ ϴ.</p> + + +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="virtualhost" id="virtualhost">ȣƮ</a></h2> + +<p><code class="directive"><a href="./mod/core.html#virtualhost"><VirtualHost></a></code> + Ư ȣƮ Ǵ þ Ѵ. ̴ +ǻͿ ٸ ȣƮ Ҷ +ϴ. ڼ <a href="vhosts/">ȣƮ </a> +϶.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="proxy" id="proxy">Ͻ</a></h2> + +<p><code class="directive"><a href="./mod/mod_proxy.html#proxy"><Proxy></a></code> +<code class="directive"><a href="./mod/mod_proxy.html#proxymatch"><ProxyMatch></a></code> + URL <code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code> Ͻ + ϴ 쿡 ȴ. , Ͻ + <code>cnn.com</code> Ʈ .</p> + +<div class="example"><p><code> +<Proxy http://cnn.com/*><br /> +Order allow,deny<br /> +Deny from all<br /> +</Proxy> +</code></p></div> +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="whatwhere" id="whatwhere">ȿ þ +ֳ?</a></h2> + +<p> Ǿȿ ִ þ ˷ þ +<a href="mod/directive-dict.html#Context"></a> Ȯ϶. +<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> +밡 þ <code class="directive"><a href="./mod/core.html#directorymatch"><DirectoryMatch></a></code>, <code class="directive"><a href="./mod/core.html#files"><Files></a></code>, <code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code>, <code class="directive"><a href="./mod/core.html#location"><Location></a></code>, <code class="directive"><a href="./mod/core.html#locationmatch"><LocationMatch></a></code>, <code class="directive"><a href="./mod/mod_proxy.html#proxy"><Proxy></a></code>, <code class="directive"><a href="./mod/mod_proxy.html#proxymatch"><ProxyMatch></a></code> ǿ 밡ϴ. +, ܰ ִ:</p> + +<ul> +<li><code class="directive"><a href="./mod/core.html#allowoverride">AllowOverride</a></code> þ +<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> +ǿ ִ.</li> + +<li><code>FollowSymLinks</code>, <code>SymLinksIfOwnerMatch</code>, +<code class="directive"><a href="./mod/core.html#options">Options</a></code> <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> ̳ +<code>.htaccess</code> Ͽ ִ.</li> + +<li><code class="directive"><a href="./mod/core.html#options">Options</a></code> þ +<code class="directive"><a href="./mod/core.html#files"><Files></a></code> +<code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code> +ǿ .</li> +</ul> +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="mergin" id="mergin">ǵ ϴ </a></h2> + +<p> ſ Ư ȴ. +þ ؼϴ ߿ ֱ +ϴ ߿ϴ.</p> + + <p>ϴ :</p> + + <ol> + <li> (ǥ ʴ) <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> <code>.htaccess</code> + ÿ Ͼ (쿡 <code>.htaccess</code> + <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> + ϵ ִ)</li> + + <li><code class="directive"><a href="./mod/core.html#directorymatch"><DirectoryMatch></a></code> ( + <code><Directory ~></code>)</li> + + <li><code class="directive"><a href="./mod/core.html#files"><Files></a></code> <code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code> ÿ Ͼ</li> + + <li><code class="directive"><a href="./mod/core.html#location"><Location></a></code> <code class="directive"><a href="./mod/core.html#locationmatch"><LocationMatch></a></code> ÿ Ͼ</li> + </ol> + + <p><code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> ϰ ǵ + Ͽ óȴ. ( 1) <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> 丮 + ª Ϳ óȴ. , + <code><Directory /var/web/dir></code> + <code><Directory /var/web/dir/subdir></code> + óѴ. 丮 Īϴ <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> + ִٸ ̵ óѴ. <code class="directive"><a href="./mod/core.html#include">Include</a></code> þ + <code class="directive"><a href="./mod/core.html#include">Include</a></code> þ ġ + ִ ó óѴ.</p> + + <p><code class="directive"><a href="./mod/core.html#virtualhost"><VirtualHost></a></code> ȿ Ե + ȣƮ ۿ ִ ش <em>Ŀ</em> ȴ. + ȣƮ ȿ ּ ִ.</p> + + <p><code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code> û Ҷ, <code class="directive"><a href="./mod/mod_proxy.html#proxy"><Proxy></a></code> + ó <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> ǰ .</p> + + <p> Ѵ.</p> + +<div class="note"><h3> </h3> + + <code><Location></code>/<code><LocationMatch></code> + (<code>Aliases</code> <code>DocumentRoot</code> Ͽ + URL ϸ ȯϴ) ̸ ܰ óȴ. + Ŀ Ѵ. +</div> + +<h3><a name="merge-examples" id="merge-examples"></a></h3> + +<p> ϴ ϴ . ̵ û +ȴٰ ϸ þ A > B > C > D > E + óȴ.</p> + +<div class="example"><p><code> +<Location /><br /> +E<br /> +</Location><br /> +<br /> +<Files f.html><br /> +D<br /> +</Files><br /> +<br /> +<VirtualHost *><br /> +<Directory /a/b><br /> +B<br /> +</Directory><br /> +</VirtualHost><br /> +<br /> +<DirectoryMatch "^.*b$"><br /> +C<br /> +</DirectoryMatch><br /> +<br /> +<Directory /a/b><br /> +A<br /> +</Directory><br /> +<br /> +</code></p></div> + +<p> . <code class="directive"><a href="./mod/core.html#location"><Location></a></code> ߿ óϹǷ +<code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> +ǿ ִ Ѱ ϴ. +, ϴ ߿ϹǷ ϶!</p> + +<div class="example"><p><code> +<Location /><br /> +Order deny,allow<br /> +Allow from all<br /> +</Location><br /> +<br /> +# ! <Directory> ƹ ȿ <br /> +<Directory /><br /> +Order allow,deny<br /> +Allow from all<br /> +Deny from badguy.example.com<br /> +</Directory> +</code></p></div> + + + +</div></div> +<div class="bottomlang"> +<p><span> : </span><a href="./en/sections.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="./fr/sections.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | +<a href="./ja/sections.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | +<a href="./ko/sections.html" title="Korean"> ko </a> | +<a href="./tr/sections.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> +</div><div class="top"><a href="#page-header"><img src="./images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Libera.chat, or sent to our <a href="https://httpd.apache.org/lists.html">mailing lists</a>.</div> +<script type="text/javascript"><!--//--><![CDATA[//><!-- +var comments_shortname = 'httpd'; +var comments_identifier = 'http://httpd.apache.org/docs/2.4/sections.html'; +(function(w, d) { + if (w.location.hostname.toLowerCase() == "httpd.apache.org") { + d.write('<div id="comments_thread"><\/div>'); + var s = d.createElement('script'); + s.type = 'text/javascript'; + s.async = true; + s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; + (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); + } + else { + d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); + } +})(window, document); +//--><!]]></script></div><div id="footer"> +<p class="apache">Copyright 2023 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="menu"><a href="./mod/"></a> | <a href="./mod/directives.html">þ</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html"></a> | <a href="./sitemap.html">Ʈ</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- +if (typeof(prettyPrint) !== 'undefined') { + prettyPrint(); +} +//--><!]]></script> +</body></html>
\ No newline at end of file diff --git a/docs/manual/sections.html.tr.utf8 b/docs/manual/sections.html.tr.utf8 new file mode 100644 index 0000000..b3a7cbf --- /dev/null +++ b/docs/manual/sections.html.tr.utf8 @@ -0,0 +1,656 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="tr" xml:lang="tr"><head> +<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> +<!-- + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + This file is generated from xml source: DO NOT EDIT + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + --> +<title>Yapılandırma Bölümleri - Apache HTTP Sunucusu Sürüm 2.4</title> +<link href="./style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> +<link href="./style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> +<link href="./style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="./style/css/prettify.css" /> +<script src="./style/scripts/prettify.min.js" type="text/javascript"> +</script> + +<link href="./images/favicon.ico" rel="shortcut icon" /></head> +<body id="manual-page"><div id="page-header"> +<p class="menu"><a href="./mod/">Modüller</a> | <a href="./mod/directives.html">Yönergeler</a> | <a href="http://wiki.apache.org/httpd/FAQ">SSS</a> | <a href="./glossary.html">Terimler</a> | <a href="./sitemap.html">Site Haritası</a></p> +<p class="apache">Apache HTTP Sunucusu Sürüm 2.4</p> +<img alt="" src="./images/feather.png" /></div> +<div class="up"><a href="./"><img title="<-" alt="<-" src="./images/left.gif" /></a></div> +<div id="path"> +<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Sunucusu</a> > <a href="http://httpd.apache.org/docs/">Belgeleme</a> > <a href="./">Sürüm 2.4</a></div><div id="page-content"><div id="preamble"><h1>Yapılandırma Bölümleri</h1> +<div class="toplang"> +<p><span>Mevcut Diller: </span><a href="./en/sections.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="./fr/sections.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | +<a href="./ja/sections.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | +<a href="./ko/sections.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | +<a href="./tr/sections.html" title="Türkçe"> tr </a></p> +</div> + + <p><a href="configuring.html">Yapılandırma dosyaları</a>ndaki + yönergeler sunucunun tamamına uygulanacağı gibi sadece belli dizinler, + dosyalar, konaklar veya URL’lere uygulanmakla sınırlanabilir. Bu + belgede, yapılandırma bölümü taşıyıcılarınının veya + <code>.htaccess</code> dosyalarının, yapılandırma dosyalarındaki diğer + yönergelerin etki alanlarını değiştirtirmek için nasıl kullanılacağı + açıklanmıştır.</p> +</div> +<div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><ul id="toc"><li><img alt="" src="./images/down.gif" /> <a href="#types">Yapılandırma Bölümü Taşıyıcılarının Türleri</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#file-and-web">Dosya Sistemi, Site Alanı ve Mantıksal İfadeler</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#virtualhost">Sanal Konaklar</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#proxy">Vekil</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#whatwhere">Hangi Yönergelere İzin Veriliyor?</a></li> +<li><img alt="" src="./images/down.gif" /> <a href="#merging">Bölümler Nasıl Katıştırılır?</a></li> +</ul><h3>Ayrıca bakınız:</h3><ul class="seealso"><li><a href="#comments_section">Yorumlar</a></li></ul></div> +<div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="types" id="types">Yapılandırma Bölümü Taşıyıcılarının Türleri</a></h2> + + <table class="related"><tr><th>İlgili Modüller</th><th>İlgili Yönergeler</th></tr><tr><td><ul><li><code class="module"><a href="./mod/core.html">core</a></code></li><li><code class="module"><a href="./mod/mod_version.html">mod_version</a></code></li><li><code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code></li></ul></td><td><ul><li><code class="directive"><a href="./mod/core.html#directory"><Directory></a></code></li><li><code class="directive"><a href="./mod/core.html#directorymatch"><DirectoryMatch></a></code></li><li><code class="directive"><a href="./mod/core.html#files"><Files></a></code></li><li><code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code></li><li><code class="directive"><a href="./mod/core.html#if"><If></a></code></li><li><code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code></li><li><code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code></li><li><code class="directive"><a href="./mod/mod_version.html#ifversion"><IfVersion></a></code></li><li><code class="directive"><a href="./mod/core.html#location"><Location></a></code></li><li><code class="directive"><a href="./mod/core.html#locationmatch"><LocationMatch></a></code></li><li><code class="directive"><a href="./mod/mod_md.html#mdomainsetsection"><MDomainSet></a></code></li><li><code class="directive"><a href="./mod/mod_proxy.html#proxy"><Proxy></a></code></li><li><code class="directive"><a href="./mod/mod_proxy.html#proxymatch"><ProxyMatch></a></code></li><li><code class="directive"><a href="./mod/core.html#virtualhost"><VirtualHost></a></code></li></ul></td></tr></table> + + <p>İki temel taşıyıcı türü vardır. Taşıyıcıların çoğu her istek için + değerlendirmeye alınır. Taşıyıcılardaki yönergeler ise sadece bu + taşıyıcılarla eşleşen istekler için uygulanır. Diğer yandan, + <code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code>, + <code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code> ve + <code class="directive"><a href="./mod/mod_version.html#ifversion"><IfVersion></a></code> + taşıyıcıları sadece sunucu başlatılırken veya yeniden başlatılırken + değerlendirmeye alınır. Başlatma sırasında gerektirdikleri koşullar + sağlanıyorsa içerdikleri yönergeler tüm isteklere uygulanır. Aksi + takdirde, içerdikleri yönergeler yok sayılır.</p> + + <p><code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code> yönergesi + sadece <code class="program"><a href="./programs/httpd.html">httpd</a></code> komut satırında uygun parametreler + tanımlanmışsa uygulanabilecek yönergeleri içerir. Örneğin, aşağıdaki + yapılandırma ile tüm isteklerin diğer siteye yönlendirilebilmesi sadece + sunucu <code>httpd -DClosedForNow</code> komut satırı ile başlatıldığı + takdirde mümkün olur:</p> + + <pre class="prettyprint lang-config"><IfDefine ClosedForNow> + Redirect "/" "http://otherserver.example.com/" +</IfDefine></pre> + + + <p><code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code> yönergesi + sadece belli bir modülün sunucuda kullanılabilir durumda olması halinde + uygulanabilecek yönergeleri içerir. Modülün ya sunucuyla birlikte durağan + olarak derlenmiş olması ya da devingen olarak derlenmiş ve yapılandırma + dosyasında yönergeden önce o modüle ilişkin bir <code class="directive"><a href="./mod/mod_so.html#loadmodule">LoadModule</a></code> satırının bulunması gerekir. Bu + yönergeyi sadece belli bir modülün varlığının veya yokluğunun + yapılandırma dosyanızın çalışmasını etkilememesini istediğiniz durumlarda + kullanmalısınız. Eksik modüllerle ilgili hata iletilerini + engellediğinden, taşıyıcı içine, her zaman çalışması istenen yönergeler + konulmamalıdır.</p> + + <p>Aşağıdaki örnekte, <code class="directive"><a href="./mod/mod_mime_magic.html#mimemagicfile">MimeMagicFile</a></code> yönergesi sadece + <code class="module"><a href="./mod/mod_mime_magic.html">mod_mime_magic</a></code> modülü mevcutsa uygulanacaktır.</p> + + <pre class="prettyprint lang-config"><IfModule mod_mime_magic.c> + MimeMagicFile "conf/magic" +</IfModule></pre> + + + <p><code class="directive"><a href="./mod/mod_version.html#ifversion"><IfVersion></a></code> + yönergesi sunucunun belli bir sürümünün çalıştırılması halinde + uygulanabilecek yönergeleri içerebilmesi dışında <code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code> ve <code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code> yönergeleri gibidir. + <code class="module"><a href="./mod/mod_version.html">mod_version</a></code> modülü farklı httpd sürümleri ve farklı + yapılandırmalarla büyük ağlarda çalışmayı mümkün kılmak veya sürüm + denemeleri yapabilmek amacıyla tasarlanmıştır.</p> + + <pre class="prettyprint lang-config"><IfVersion >= 2.4> + # burası sadece 2.4.0 veya daha üstü sürümlerde + # iş görür. +</IfVersion></pre> + + + <p><code class="directive"><a href="./mod/core.html#ifdefine"><IfDefine></a></code>, + <code class="directive"><a href="./mod/core.html#ifmodule"><IfModule></a></code> ve + <code class="directive"><a href="./mod/mod_version.html#ifversion"><IfVersion></a></code> + yönergelerinin önüne "!" konularak olumsuz koşullar için uygulanabilir. + Ayrıca, bu bölümler daha karmaşık sınırlamalar elde etmek amacıyla bir + diğerinin içinde kullanılabilirler.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="file-and-web" id="file-and-web">Dosya Sistemi, Site Alanı ve Mantıksal İfadeler</a></h2> + + + <p>En sık kullanılan yapılandırma bölümü taşıyıcıları dosya sistemindeki + veya site alanındaki belli yerlerin yapılandırmalarını değiştirmekte + kullanılanlardır. Öncelikle, bu ikisi arasındaki farkları bilmek + önemlidir. Dosya sistemi disklerinizin işletim sistemi tarafından size + gösterilen halidir. Örneğin, öntanımlı kurulumda Apache httpd, Unix + sistemlerinde <code>/usr/local/apache2</code> altındayken Windows + sistemlerinde <code>"c:/Program Files/Apache Group/Apache2"</code> + altındadır. (Bilgi: Windows için bile, Apache httpd yapılandırma + dosyalarında dosya yolu belirtilirken tersbölü değil normal bölü + karakterleri kullanılır.) Site alanı ise sunucu tarafından istemciye + sunulan dizin ağacıdır. Yani, site alanı içindeki <code>/dir/</code> + dizini, Apache httpd’nin Unix üzerinde dosya sistemine öntanımlı olarak + kurulduğu yer göz önüne alınarak, dosya sistemindeki + <code>/usr/local/apache2/htdocs/dir/</code> dizinine karşılıktır. Site + sayfaları veritabanlarından veya başka yerlerden devingen olarak + üretilebildiğinden site alanlarının doğrudan dosya sistemine eşlenmesi + gerekli değildir.</p> + + <h3><a name="filesystem" id="filesystem">Dosya Sistemi Taşıyıcıları</a></h3> + + <p><code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> + ve <code class="directive"><a href="./mod/core.html#files"><Files></a></code> + taşıyıcıları, <a class="glossarylink" href="./glossary.html#regex" title="sözlüğe bakınız">düzenli ifade</a> karşılıkları + ile beraber, yönergeleri dosya sisteminin parçalarına uygularlar. Bir + <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> bölümü + içindeki yönergeler belli bir dosya sistemi dizinine ve onun alt + dizinlerine uygulanır. Aynı etki <a href="howto/htaccess.html">.htaccess + dosyaları</a> kullanılarak da sağlanabilir. Örneğin aşağıdaki + yapılandırmada, <code>/var/web/dir1</code> dizini ve alt dizinlerinde + dizin içeriğinin listelenmesi etkin kılınmaktadır.</p> + + <pre class="prettyprint lang-config"><Directory "/var/web/dir1"> + Options +Indexes +</Directory></pre> + + + <p>Bir <code class="directive"><a href="./mod/core.html#files"><Files></a></code> bölümü + içindeki yönergeler, hangi dizinde bulunduğuna bakılmaksızın ismi + belirtilen dosyalara uygulanır. Örneğin, aşağıdaki yapılandırma + yönergeleri yapılandırma dosyasının ana bölümüne yerleştirildiği takdirde + <code>gizli.html</code> isimli dosyalara nerede bulunursa bulunsun + erişime izin vermeyecektir.</p> + + <pre class="prettyprint lang-config"><Files "gizli.html"> + Require all denied +</Files></pre> + + + <p>Dosya sisteminin belli bir yerindeki belli dosyalarla ilgili yaptırımlar + için <code class="directive"><a href="./mod/core.html#files"><Files></a></code> ve + <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> bölümleri + birlikte kullanılabilir. Örneğin, aşağıdaki yapılandırma + <code>/var/web/dir1/gizli.html</code>, + <code>/var/web/dir1/subdir2/gizli.html</code>, + <code>/var/web/dir1/subdir3/gizli.html</code> ve + <code>/var/web/dir1/</code> altında bulunabilecek diğer tüm + <code>gizli.html</code> dosyalarına erişimi yasaklar.</p> + + <pre class="prettyprint lang-config"><Directory "/var/web/dir1"><br /> + <Files "gizli.html"><br /> + Require all denied + </Files><br /> +</Directory></pre> + + + + <h3><a name="webspace" id="webspace">Site Alanı Taşıyıcıları</a></h3> + + <p><code class="directive"><a href="./mod/core.html#location"><Location></a></code> yönergesi + ve yönergenin <a class="glossarylink" href="./glossary.html#regex" title="sözlüğe bakınız">düzenli ifade</a> karşılığı + site alanındaki içerik için yapılandırmayı değiştirir. Örneğin aşağıdaki + yapılandırma, <code>/gizli</code> ile başlayan URL yollarına erişimi + engeller. Özellikle, <code>http://siteniz.mesela.dom/gizli</code>, + <code>http://siteniz.mesela.dom/gizli123</code> ve + <code>http://siteniz.mesela.dom/gizli/dir/dosya.html</code> + istekleri yanında <code>/gizli</code> ile başlayan diğer isteklere de + uygulanır.</p> + + <pre class="prettyprint lang-config"><LocationMatch "^/gizli"> + Require all denied +</LocationMatch></pre> + + + <p>Dosya sistemi ile etkileşime girmeyen herşey için + <code class="directive"><a href="./mod/core.html#location"><Location></a></code> + yönergesi gerekir. Aşağıdaki örnekte, belli bir URL’nin + <code class="module"><a href="./mod/mod_status.html">mod_status</a></code> modülü tarafından sağlanan bir dahili + Apache eylemcisine nasıl eşlenebileceği gösterilmiştir. Bu örnek + için dosya sisteminde <code>server-status</code> adında bir dosya + veya dizin bulunması gerekli değildir.</p> + + <pre class="prettyprint lang-config"><Location "/server-status"> + SetHandler server-status +</Location></pre> + + + + <h3><a name="overlapping-webspace" id="overlapping-webspace">Site Alanında Çakışma</a></h3> + <p>Belli bölümler ve yönergeler değerlendirilirken çakışan iki URL bir URL + olarak dikkate alınır. <code class="directive"><a href="./mod/core.html#location"><Location></a></code> yönergesi için bu şöyle olurdu:</p> + + <pre class="prettyprint lang-config"><Location "/foo"> +</Location> +<Location "/foo/bar"> +</Location></pre> + + + <p>Diğer yandan <code class="directive"><a href="./mod/mod_alias.html#takma adlar"><Takma + adlar></a></code> tam tersi eşlenir:</p> + + <pre class="prettyprint lang-config">Alias "/foo/bar" "/srv/www/uncommon/bar" +Alias "/foo" "/srv/www/common/foo"</pre> + + + <p>Aynısı <code class="directive"><a href="./mod/mod_proxy.html#proxypass">ProxyPass</a></code> + yönergeleri için de geçerlidir:</p> + + <pre class="prettyprint lang-config">ProxyPass "/special-area" "http://special.example.com" smax=5 max=10 +ProxyPass "/" "balancer://mycluster/" stickysession=JSESSIONID|jsessionid nofailover=On</pre> + + + + <h3><a name="wildcards" id="wildcards">Dosya Adı Şablonları ve Düzenli İfadeler</a></h3> + + + <p><code class="directive"><a href="./mod/core.html#directory"><Directory></a></code>, + <code class="directive"><a href="./mod/core.html#files"><Files></a></code> ve + <code class="directive"><a href="./mod/core.html#location"><Location></a></code> + yönergelerinde, Standart C kütüphanesindeki <code>fnmatch</code> + işlevindeki gibi kabuk tarzı dosya ismi kalıpları kullanılabilir. "*" + karakteri herhangi bir karakter dizisi ile eşleşirken "?" karakteri tek + tek karakterlerle ve "[<em>seq</em>]" kalıbı ise <em>seq</em> içindeki + her karakterle eşleşir. "/" karakteri her hangi bir kalıp karakteri ile + eşleşmez; açıkça belirtilmesi gerekir.</p> + + <p>Daha esnek bir eşleşmenin gerekli olduğu durumlar için her taşıyıcının + bir düzenli ifade karşılığı vardır. <code class="directive"><a href="./mod/core.html#directorymatch"><DirectoryMatch></a></code>, <code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code> ve <code class="directive"><a href="./mod/core.html#locationmatch"><LocationMatch></a></code> yönergelerinde gerekli + eşleşmeleri seçmek için perl uyumlu <a class="glossarylink" href="./glossary.html#regex" title="sözlüğe bakınız">düzenli + ifadelerin</a> kullanımına izin verilir. Ayrıca, yönergelerin + uygulanışının düzenli ifade bölümleri kullanılarak nasıl + değiştirileceğini öğrenmek için, aşağıda, yapılandırmanın + katıştırılmasıyla ilgili bölüme de bakınız.</p> + + <p>Tüm kullanıcı dizinlerine ilişkin yapılandırmayı değiştirmek için dosya + ismi kalıpları şöyle kullanılabilirdi:</p> + + <pre class="prettyprint lang-config"><Directory "/home/*/public_html"> + Options Indexes +</Directory></pre> + + + <p>Düzenli ifade bölümleri kullanarak çeşitli türlerdeki resim dosyalarına + erişimi bir defada yasaklayabiliriz:</p> + + <pre class="prettyprint lang-config"><FilesMatch "\.(?i:gif|jpe?g|png)$"> + Require all denied +</FilesMatch></pre> + + + <p><strong>İsimli gruplar ve geriye başvurular</strong> içeren düzenli + ifadeler ortama eklenirken ilgili isimler büyük harfli yapılır. Böylece, + URL'lere ve dosya yolları elemanlarına <a href="expr.html">ifadelerin + içinden</a> ve <code class="module"><a href="./mod/mod_rewrite.html">mod_rewrite</a></code> gibi modüllerden başvurmak + mümkün olur.</p> + +<pre class="prettyprint lang-config"><DirectoryMatch "^/var/www/combined/(?<SITENAME>[^/]+)"> + Require ldap-group "cn=%{env:MATCH_SITENAME},ou=combined,o=Example" +</DirectoryMatch></pre> + + + + <h3><a name="expressions" id="expressions">Mantıksal İfadeler</a></h3> + <p><code class="directive"><a href="./mod/core.html#if"><If></a></code> yönergesi bir + mantıksal ifade olarak belirtilebilen bir kurala bağlı olarak + yapılandırmayı değiştirebilir. Örneğin, aşağıdaki yapılandırmada, + <code>HTTP Referer</code> başlığı "http://www.example.com/" ile + başlamıyorsa erişimi yasaklar.</p> + + <pre class="prettyprint lang-config"><If "!(%{HTTP_REFERER} -strmatch 'http://www.example.com/*')"> + Require all denied +</If></pre> + + + + <h3><a name="whichwhen" id="whichwhen">Ne, Ne Zaman Kullanılır?</a></h3> + <p>Dosya sistemi taşıyıcıları ile site alanı taşıyıcıları arasında seçim + yapmak aslında oldukça kolaydır. Dosya sisteminde bulunan nesnelere + uygulanacak yönergeler için daima <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> veya <code class="directive"><a href="./mod/core.html#files"><Files></a></code> kullanılır. Dosya sisteminde bulunmayan nesnelere + (bir sayfanın bir veritabanı tarafından üretilmesi gibi) uygulanacak + yönergeler için ise <code class="directive"><a href="./mod/core.html#location"><Location></a></code> kullanılır.</p> + + <p>Dosya sistemindeki nesnelere erişimi kısıtlarken asla + <code class="directive"><a href="./mod/core.html#location"><Location></a></code> + kullanmamak önemlidir. Bunun sebebi farklı site alanı konumlarının + (URL’ler) aynı dosya sistemi konumuna eşlenebilmesi dolayısıyla + kısıtlamalarınızın etrafından dolaşılabilmesine izin vermesidir. + Örneğin, aşağıdaki yapılandırmayı ele alalım:</p> + + <pre class="prettyprint lang-config"><Location "/dir/"> + Require all denied +</Location></pre> + + + <p><code>http://siteniz.mesela.dom/dir/</code> için bir istek yapılmışsa + bu doğru çalışacaktır. Fakat dosya sistemi harf büyüklüğüne duyarsızsa + ne olacak? Kısıtlamanız, istek + <code>http://siteniz.mesela.dom/DIR/</code> + şeklinde yapılarak kolayca geçersiz kılınabilir. Halbuki <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> yönergesi isteğin + nasıl yapıldığına bakılmaksızın bu konumdan sunulan her türlü içeriğe + uygulanacaktı. (Dosya sistemi bağlarıyla bu da aşılabilir. Sembolik + bağlar kullanılarak aynı dizin dosya sisteminin bir çok yerine + yerleştirilebilir. <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> yönergesi dosya yolunu sıfırlamaksızın sembolik + bağları izleyecektir. Bu bakımdan, en yüksek seviyede güvenlik için uygun + <code class="directive"><a href="./mod/core.html#options">Options</a></code> yönergesi ile sembolik + bağların izlenmesi devredışı bırakılabilir.)</p> + + <p>Belki de siz sırf harf büyüklüğüne duyarlı bir dosya sistemi + kullanıyorsunuz diye böyle uygulamalara ihtiyacınız olmadığını düşünüyor + olabilirsiniz, fakat aynı site alanını çok sayıda dosya sistemi konumuna + eşleyecek daha bir sürü yol bulunduğunu unutmayınız. Bu bakımdan dosya + sisteminde yapacağınız kısıtlamalarda daima dosya sistemi taşıyıcılarını + kullanmalısınız. Bununla birlikte bu kuralın da bir istisnası vardır. + Yapılandırma kısıtlamalarının bir <code><Location "/"></code> bölümü + içine koyulması, bu bölüme konan yönergelerin etki alanının belli bir URL + ile sınırlı olmaması nedeniyle mükemmelen güvenlidir.</p> + + + <h3><a name="nesting" id="nesting">Bölüm iç içeliği</a></h3> + <p>Bazı bölüm türleri başka bölüm türlerinin içinde olabilir. Bir yandan, + <code class="directive"><a href="./mod/core.html#files"><Files></a></code> bölümü + <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> bölümünün + içinde bulunabilirken diğer yandan bir <code class="directive"><a href="./mod/core.html#if"><If></a></code> bölümü <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code>, <code class="directive"><a href="./mod/core.html#location"><Location></a></code> ve <code class="directive"><a href="./mod/core.html#files"><Files></a></code> bölümlerinde bulunabilir fakat + başka bir <code class="directive"><a href="./mod/core.html#if"><If></a></code> bölümünün + içinde bulunamaz. Bu bölümlerin düzenli ifadeli türevleri de benzer tarzda + davranır.</p> + + <p>İç içe bölümler, aynı türdeki iç içe olmayan bölümlerin sonrasına + yerleştirilir.</p> + + +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="virtualhost" id="virtualhost">Sanal Konaklar</a></h2> + + <p><code class="directive"><a href="./mod/core.html#virtualhost"><VirtualHost></a></code> + taşıyıcısının içinde belli bir konağa uygulanan yönergeler bulunur. + Aynı makinede çok sayıda konağı farklı yapılandırmalarla sunuyorsanız + bu taşıyıcı çok işinize yarar. Daha fazla bilgi için + <a href="vhosts/">Sanal Konak Belgeleri</a> bölümüne bakınız.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="proxy" id="proxy">Vekil</a></h2> + <p><code class="directive"><a href="./mod/mod_proxy.html#proxy"><Proxy></a></code> + ve <code class="directive"><a href="./mod/mod_proxy.html#proxymatch"><ProxyMatch></a></code> + taşıyıcıları, sadece belli bir URL ile eşleşen <code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code> + vekil sunucusu üzerinden erişilen sitelere uygulanan yapılandırma + yönergelerini bulundururlar. Örneğin aşağıdaki yapılandırma + <code>example.com</code> sitesine erişim için vekil sunucunun + sadece ağdaki bazı kullanıcılar tarafından kullanılabilmesini sağlayacaktır.</p> + + <pre class="prettyprint lang-config"><Proxy "http://www.example.com/*"> + Require host bizimki.example.com +</Proxy></pre> + +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="whatwhere" id="whatwhere">Hangi Yönergelere İzin Veriliyor?</a></h2> + <p>Hangi yönergelere hangi yapılandırma bölümlerinde izin verildiğini + öğrenmek için yönerge <a href="mod/directive-dict.html#Context">bağlamına</a> bakınız. <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> bölümlerinde + izin verilen herşeye sözdizimsel olarak ayrıca + <code class="directive"><a href="./mod/core.html#directorymatch"><DirectoryMatch></a></code>, + <code class="directive"><a href="./mod/core.html#files"><Files></a></code>, + <code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code>, + <code class="directive"><a href="./mod/core.html#location"><Location></a></code>, + <code class="directive"><a href="./mod/core.html#locationmatch"><LocationMatch></a></code>, + <code class="directive"><a href="./mod/mod_proxy.html#proxy"><Proxy></a></code> + ve <code class="directive"><a href="./mod/mod_proxy.html#proxymatch"><ProxyMatch></a></code> + bölümlerinde de izin verilir. Yine de bazı istisnai durumlar + mevcuttur:</p> + + <ul> + <li><code class="directive"><a href="./mod/core.html#allowoverride">AllowOverride</a></code> yönergesi sadece + <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> + bölümlerinde çalışır.</li> + + <li><code class="directive"><a href="./mod/core.html#options">Options</a></code> yönergesinin + <code>FollowSymLinks</code> ve <code>SymLinksIfOwnerMatch</code> + seçenekleri sadece <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> bölümlerinde veya <code>.htaccess</code> + dosyalarında çalışır.</li> + + <li><code class="directive"><a href="./mod/core.html#options">Options</a></code> yönergesi + <code class="directive"><a href="./mod/core.html#files"><Files></a></code> ve + <code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code> + bölümlerinde kullanılamaz.</li> + </ul> +</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> +<div class="section"> +<h2><a name="merging" id="merging">Bölümler Nasıl Katıştırılır?</a></h2> + + <p>Yapılandırma bölümleri belli bir sıra ile uygulanır. Yapılandırma + yönergelerinin yorumlanışı üzerinde önemli etkilere sahip olabilmesi + nedeniyle neyin ne zaman çalıştığını anlamak çok önemlidir.</p> + + <p>Yapılandırma bölümlerinin katıştırılma sırası şöyledir:</p> + + <ol> + <li><code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> (düzenli ifadeler hariç) + ve <code>.htaccess</code> aynı anda işleme sokulur + (<code>.htaccess</code> ile eğer izin verilmişse <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> içindeki bazı + yönergeler geçersiz kılınabileceği için).</li> + + <li><code class="directive"><a href="./mod/core.html#directorymatch"><DirectoryMatch></a></code> + (ve <code><Directory "~"></code>).</li> + + <li><code class="directive"><a href="./mod/core.html#files"><Files></a></code> ve + <code class="directive"><a href="./mod/core.html#filesmatch"><FilesMatch></a></code> aynı anda + işleme sokulur.</li> + + <li><code class="directive"><a href="./mod/core.html#location"><Location></a></code> + ve <code class="directive"><a href="./mod/core.html#locationmatch"><LocationMatch></a></code> + aynı anda işleme sokulur.</li> + + <li><code class="directive"><a href="./mod/core.html#if"><If></a></code> bölümleri, + önceki bağlamlardan herhangi birinin içine alınmış olsalar bile. + + </li> + </ol> + + <p>Bazı önemli durumlar:</p> + <ul> + <li><code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> + bölümündekiler hariç, her grup, yapılandırma dosyasında bulundukları + sıraya göre işleme sokulurlar. Örneğin, 4. grupta <em>/foo/bar</em> için yapılan + bir istek <code><Location "/foo/bar"></code> ve <code><Location + "/foo"></code> bölümleriyle de eşleşir ve bunlar yapılandırma + dosyalarında bulundukları sıraya göre değerlendirilir.</li> + + <li>Yukarıda 1. grup olan <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> bölümü en kısa dizin elemanından en uzun + dizin elemanına doğru işleme sokulur. Yani, örneğin, <code><Directory + "/var/web/dir"></code> bölümü <code><Directory + "/var/web/dir/subdir"></code> bölümünden önce işleme sokulacaktır.</li> + + <li>Eğer aynı dizin için birden fazla <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> bölümü varsa bunlar yapılandırma + dosyasında bulundukları sıraya göre işleme sokulurlar.</li> + + <li><code class="directive"><a href="./mod/core.html#include">Include</a></code> yönergeleri ile + yapılandırmaya dahil edilen dosyaların içerikleri <code class="directive"><a href="./mod/core.html#include">Include</a></code> yönergesinin bulunduğu yere konulduktan + sonra işleme sokulurlar.</li> + + <li><code class="directive"><a href="./mod/core.html#virtualhost"><VirtualHost></a></code> + bölümlerinin içindeki bölümler, sanal konak tanımı dışındaki + karşılıklarından <em>sonra</em> uygulanırlar. Bu yöntemle ana sunucu + yapılandırmasındaki tanımlar geçersiz kılınabilir</li> + + <li>İstek <code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code> tarafından sunulduğu takdirde, + <code class="directive"><a href="./mod/mod_proxy.html#proxy"><Proxy></a></code> taşıyıcısı + işlem sırasında <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> taşıyıcısının yerini alır.</li> + + <li>katıştırma düzeni üzerindeki etkisi nedeniyle, ilgili yapılandırma + yönergelerini <code class="directive"><a href="./mod/core.html#if"><If></a></code>'in + içinde ve dışında karıştırırken dikkatli olunmalıdır. Doğrudan + <code class="directive"><a href="./mod/core.html#else"><Else></a></code> kullanımının + yardımı olabilir.</li> + + <li><code>.htaccess</code> içinde <code class="directive"><a href="./mod/core.html#if"><If></a></code> kullanıldığında, üst dizindeki sarmalanmış + yönergeler, alt dizinde sarmalanmamış yönergelerden <em>sonra</em> + birleştirilir.</li> + </ul> + + <div class="note"><h3>Bazı Teknik Bilgiler</h3> + Aslında, isim dönüşüm aşamasından (<code>Aliases</code> ve + <code>DocumentRoots</code>, URL’leri dosya isimlerine eşlemek için + kullanılırken) hemen önce uygulanan bir + <code><Location></code>/<code><LocationMatch></code> dizisi + vardır. Bu dizinin sonuçları isim dönüşüm aşaması tamamlandıktan sonra + tamamen elden çıkarılır. + </div> + + <h3><a name="relationship-module-configuration" id="relationship-module-configuration">Modüllerle + yapılandırma bölümleri arasındaki ilişki</a></h3> + + <p>Yapılandırma bölümlerini okurken örneğin <code class="module"><a href="./mod/mod_rewrite.html">mod_rewrite</a></code> + gibi belli modüllerin yönergelerinin bu bölümlere nasıl katılacağı ve + ne zaman nasıl işleneceği gibi sorular sıkça aklımızdan geçer. Bunun + belli bir yanıtı yoktur ve biraz temel bilgi gerektirir. Her httpd + modülü yapılandırmasını kendi yönetir ve httpd.conf içindeki + yönergelerinin her biri belli bir bağlamdaki bir yapılandırmayı + belirtir. httpd bir komutu okunduğu sırada çalıştırmaz.</p> + + <p>Çalışma anında, httpd çekirdeği geçerli isteğe hangilerinin + uygulanacağını belirlemek için yukarıda açıklanan sırada tanımlı + yapılandırma bölümlerini tekrar tekrar okur. Eşleşen ilk bölümün bu + istek için geçerli yapılandırmayı içerdiği varsayılır. Eğer alt + bölümlerden biri de eşleşmişse bu bölümlerde yönergeleri bulunan her + modüle yapılandırmasını iki bölüm arasında katıştırma şansı verilir. + Sonuç üçüncü bir yapılandırma olup işlem bütün yapılandırma bölümleri + değerlendirilene kadar sürer.</p> + + <p>Yukarıdaki adımların ardından HTTP isteğiyle ilgili "asıl" işlem + başlar: her modül ondan istenen görevleri gerçekleştirme şansına sahip + olur. Nasıl davranacaklarını belirlemek için kendilerinin katıştırılmış + son yapılandırmalarını http çekirdeğinden alabilirler.</p> + + <p>Sürecin tamamı bir örnekle görselleştirilebilir. Aşağıdaki örnekte + belli bir HTTP başlığını ayarlamak için <code class="module"><a href="./mod/mod_headers.html">mod_headers</a></code> + modülünün <code class="directive"><a href="./mod/mod_headers.html#header">Header</a></code> yönergesi + kullanılmıştır. <code>/example/index.html</code> isteği için httpd + <code>CustomHeaderName</code> başlığına hangi değeri atayacaktır? + </p> + <pre class="prettyprint lang-config"><Directory "/"> + Header set CustomHeaderName bir + <FilesMatch ".*"> + Header set CustomHeaderName yedi + </FilesMatch> +</Directory> + +<Directory "/example"> + Header set CustomHeaderName iki +</Directory></pre> + + <ul> + <li><code class="directive">Directory</code> "/" eşleşir ve ilk yapılandırma + olarak <code>CustomHeaderName</code> başlığı <code>bir</code> + değeriyle oluşturulur.</li> + + <li><code class="directive">Directory</code> "/example" eşleşir ve + <code class="module"><a href="./mod/mod_headers.html">mod_headers</a></code> modülünün koduna göre bir katıştırma + durumundan yeni değer eskiyi geçersiz kılacağından yeni bir + yapılandırma ile <code>CustomHeaderName</code> başlığının değeri + <code>iki</code> yapılır.</li> + + <li><code class="directive">FilesMatch</code> ".*" eşleşir ve başka bir + katıştırma fırsatı doğar: <code>CustomHeaderName</code> başlığının + değeri <code>yedi</code> yapılır.</li> + + <li>Neticede HHP isteğinin sonraki adımlarında + <code class="module"><a href="./mod/mod_headers.html">mod_headers</a></code> çağrılıp <code>yedi</code> değeri + atanmış <code>CustomHeaderName</code> başlığını işleme sokması + istenecektir. <code class="module"><a href="./mod/mod_headers.html">mod_headers</a></code> normalde işini yapmak + için bu yapılandırmayı kullanacaktır. Fakat bundan, bir yönergenin + gerekli olmaması veya kullanımdan kaldırılması ve benzeri nedenlerle + yapılandırmada iptal edilmesi gibi daha karmaşık bir eylemi bir + modülün gerçekleştiremeyeceği anlamı çıkarılmamalıdır.</li> + </ul> + + <p><code class="directive">Directory</code> ile aynı katıştırma sırasından dolayı + bu durum .htaccess için de geçerlidir. Burada anlaşılması gereken husus, + <code class="directive">Directory</code> ve <code class="directive">FilesMatch</code> + gibi yapılandırma bölümlerinin <code class="directive"><a href="./mod/mod_headers.html#header">Header</a></code> veya <code class="directive"><a href="./mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> gibi modüle özgü + yönergelerle karşılaştırılmamasıdır, çünkü bunlar farklı seviyelerde + işlem görür. + </p> + + + <h3><a name="merge-examples" id="merge-examples">Bazı Örnekler</a></h3> + + <p>Aşağıdaki yapay örnekte katıştırma sırası gösterilmiştir. Hepsinin aynı + isteğe uygulandığı varsayımıyla, bu örnekteki yönergeler A > B > C + > D > E sırasıyla uygulanacaktır.</p> + + <pre class="prettyprint lang-config"><Location "/"> + E +</Location> + +<Files "f.html"> + D +</Files> + +<VirtualHost *> + <Directory "/a/b"> + B + </Directory> +</VirtualHost> + +<DirectoryMatch "^.*b$"> + C +</DirectoryMatch> + +<Directory "/a/b"> + A +</Directory></pre> + + + <p>Daha somut bir örnek olarak aşağıdakini ele alalım. + <code class="directive"><a href="./mod/core.html#directory"><Directory></a></code> + bölümlerindeki erişim sınırlamaları ne olursa olsun <code class="directive"><a href="./mod/core.html#location"><Location></a></code> bölümü son olarak + değerlendirmeye alınacak ve sunucuya sınırsız erişim verecektir. + Başka bir deyişle, katıştırma sırası önemlidir, bu nedenle dikkatli + olmalısınız!</p> + + <pre class="prettyprint lang-config"><Location "/"> + Require all granted +</Location> + +# Alooo! Bu <Directory> bölümünün hiçbir hükmü yok. +<Directory "/"> + <RequireAll> + Require all granted + Require not host kkadam.example.com + </RequireAll> +</Directory></pre> + + + + +</div></div> +<div class="bottomlang"> +<p><span>Mevcut Diller: </span><a href="./en/sections.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="./fr/sections.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | +<a href="./ja/sections.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | +<a href="./ko/sections.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | +<a href="./tr/sections.html" title="Türkçe"> tr </a></p> +</div><div class="top"><a href="#page-header"><img src="./images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Yorumlar</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Libera.chat, or sent to our <a href="https://httpd.apache.org/lists.html">mailing lists</a>.</div> +<script type="text/javascript"><!--//--><![CDATA[//><!-- +var comments_shortname = 'httpd'; +var comments_identifier = 'http://httpd.apache.org/docs/2.4/sections.html'; +(function(w, d) { + if (w.location.hostname.toLowerCase() == "httpd.apache.org") { + d.write('<div id="comments_thread"><\/div>'); + var s = d.createElement('script'); + s.type = 'text/javascript'; + s.async = true; + s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; + (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); + } + else { + d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); + } +})(window, document); +//--><!]]></script></div><div id="footer"> +<p class="apache">Copyright 2023 The Apache Software Foundation.<br /><a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> altında lisanslıdır.</p> +<p class="menu"><a href="./mod/">Modüller</a> | <a href="./mod/directives.html">Yönergeler</a> | <a href="http://wiki.apache.org/httpd/FAQ">SSS</a> | <a href="./glossary.html">Terimler</a> | <a href="./sitemap.html">Site Haritası</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- +if (typeof(prettyPrint) !== 'undefined') { + prettyPrint(); +} +//--><!]]></script> +</body></html>
\ No newline at end of file |