Practical mod_perl / HTML Book /



previous page: 4.1.3.3. <Location URI> ... </Location>
  
page up: HTML Version of the book
  
next page: 4.1.5. Subgrouping of <Directory>, <Location>, and <Files> Sections

4.1.4. Merging <Directory>, <Location>, and <Files> Sections


When configuring the server, it's important to understand the order in which the rules of each section are applied to requests. The order of merging is:

  1. <Directory> (except for regular expressions) and .htaccess are processed simultaneously, with the directives in .htaccess overriding <Directory>.

  2. <DirectoryMatch> and <Directory ~ > with regular expressions are processed next.

  3. <Files> and <FilesMatch> are processed simultaneously.

  4. <Location> and <LocationMatch> are processed simultaneously.

Apart from <Directory>, each group is processed in the order in which it appears in the configuration files. <Directory>s (group 1 above) are processed in order from the shortest directory component to the longest (e.g., first / and only then /home/www). If multiple <Directory>sections apply to the same directory, they are processed in the configuration file order.

Sections inside <VirtualHost>sections are applied as if you were running several independent servers. The directives inside one <VirtualHost>section do not interact with directives in other <VirtualHost>sections. They are applied only after processing any sections outside the virtual host definition. This allows virtual host configurations to override the main server configuration.

If there is a conflict, sections found later in the configuration file override those that come earlier.

 

Continue to:

  • prev: 4.1.3.3. <Location URI> ... </Location>
  • Table of Contents
  • next: 4.1.5. Subgrouping of <Directory>, <Location>, and <Files> Sections







TOP
previous page: 4.1.3.3. &lt;Location URI&gt; ... &lt;/Location&gt;
  
page up: HTML Version of the book
  
next page: 4.1.5. Subgrouping of &lt;Directory&gt;, &lt;Location&gt;, and &lt;Files&gt; Sections


Menu

  • HTML Book
  • PDF Book
  • Download Code
  • Table of Contents
  • Errata
  • mod_perl2 User's Guide
  • Sitemap

Search


Add to Google




Creative Commons License


Written by
Eric Cholet (Logilune) and
Stas Bekman (StasoSphere & Free Books).


[ Privacy Policy | Terms of Use | About Us | Search ]

© 2007 StasoSphere.com