WEBVTT

00:04.110 --> 00:09.900
In this video we're going to take a look at inheritance and the three different types of directives

00:10.440 --> 00:13.060
we've already touched on the concept of inheritance.

00:13.080 --> 00:19.290
And you've most likely by now realize that as with scope in a typical programming language an engine

00:19.290 --> 00:24.090
X context inherits configurations from its parent contexts.

00:24.580 --> 00:30.440
This is generally a very straightforward top to bottom inheritance starting at the main context.

00:30.460 --> 00:39.050
The file itself down to that HTP context then the server context and finally any location context.

00:39.250 --> 00:45.400
That said Inheritance isn't always the straight forward and will vary depending on the type of directive

00:45.430 --> 00:49.090
being inherited from the three main directive types.

00:49.090 --> 00:54.480
Is this standard directive the array directive and the action directive.

00:54.520 --> 00:57.530
Now I won't be demonstrating the different types of directives.

00:57.550 --> 01:04.210
As I've previously done with small configuration changes but rather I compiled the sample configuration

01:04.240 --> 01:08.680
with detailed comments explaining how each directive works.

01:08.680 --> 01:11.490
So let's go over that first up.

01:11.500 --> 01:15.510
No one here we have what's called an array type directive.

01:15.700 --> 01:22.270
This is a directive that can be declared multiple times without overriding the previous the axis log

01:22.300 --> 01:28.810
being the perfect example of an array directive array directive sets inherited straight down meaning

01:28.870 --> 01:35.120
all child contexts of this main context will share these log file settings.

01:35.230 --> 01:37.860
For example the server context here.

01:38.570 --> 01:42.930
If I were ever a child context redeclare is this directive at all.

01:42.950 --> 01:48.000
So even only once the parent directive gets overridden completely.

01:48.260 --> 01:53.030
As would be the case here in this site to dot com server context.

01:53.030 --> 02:00.530
This entire context and all it's child context so these locations will have access logs completely disabled.

02:00.590 --> 02:04.610
Unless of course one of these child contexts declares its own access log.

02:04.670 --> 02:06.880
Again and so on.

02:06.890 --> 02:10.620
Then secondly we have this standard directive.

02:10.670 --> 02:16.190
This being the most common directive type and can only be declared once in a given context.

02:16.190 --> 02:22.640
Inheritance working exactly the same as the array directive parent to child with the child being able

02:22.640 --> 02:25.410
to override it with its own declaration.

02:25.760 --> 02:30.390
And finally the third directive type is the action directive.

02:30.590 --> 02:38.090
This being directives that invoke some or other break or action in the configuration for example a redirect

02:38.150 --> 02:46.250
via the return directive a response such as this one also via the return directive or alternatively

02:46.250 --> 02:50.830
a rewrite from either a rewrite or try files directive.

02:51.110 --> 02:57.320
Inheritance simply does not apply to action directives as they stop the normal flow of the configuration.

02:57.930 --> 03:03.450
That covers the three types of directives and the basics of inheritance which again is very important

03:03.450 --> 03:04.510
to understand.

03:04.620 --> 03:08.570
So be sure to download this linked configuration file for reference.
