13.06.2015 Views

Introduction to the Apache Web Server - ApacheCon

Introduction to the Apache Web Server - ApacheCon

Introduction to the Apache Web Server - ApacheCon

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

.htaccess<br />

/usr/.htaccess<br />

/usr/local/.htaccess<br />

/usr/local/apache/.htaccess<br />

/usr/local/apache/htdocs/.htaccess<br />

/usr/local/apache/htdocs/services/.htaccess<br />

/usr/local/apache/htdocs/services/training/.htaccess<br />

/usr/local/apache/htdocs/services/training/apache/.htaccess<br />

Note that this is <strong>the</strong> absurd worst case, and never happens in practice. In order <strong>to</strong> make this happen,<br />

you’d have <strong>to</strong> have AllowOveride All set for / which nobody in <strong>the</strong>ir right mind would ever do. On <strong>the</strong><br />

o<strong>the</strong>r hand, we should not assume anything. People unaware of <strong>the</strong> impact of this might indeed <strong>to</strong> that for<br />

convenience. But in practice, you end up checking for .htaccess files down <strong>to</strong> whatever lowest level you have<br />

permitted AllowOverride.<br />

Thus, if you:<br />

<br />

AllowOverride All<br />

<br />

Then you’d really only get requests for:<br />

/usr/local/apache/htdocs/.htaccess<br />

/usr/local/apache/htdocs/services/.htaccess<br />

/usr/local/apache/htdocs/services/training/.htaccess<br />

/usr/local/apache/htdocs/services/training/apache/.htaccess<br />

Which is still a little much, but less serious. Note, however, that dropping <strong>the</strong> AllowOverride directive<br />

in this scenario gives 2- or 3-fold performance improvement, even for direc<strong>to</strong>ries where you’re not using<br />

.htaccess files at all, based on my benchmarks. I’d recommend that you do your own benchmarks <strong>to</strong> verify<br />

<strong>the</strong>se numbers.<br />

• Directives found will be applied in <strong>the</strong> order that <strong>the</strong>y are found, overriding previous settings.<br />

• This is done every time a file is served<br />

• Can have multiple settings for AccessFileName<br />

AccessFileName .htaccess .acl direc<strong>to</strong>ry.conf<br />

In which case, it will look for each of <strong>the</strong>se files in each direc<strong>to</strong>ry<br />

28

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!