1 00:00:04,110 --> 00:00:09,900 In this video we're going to take a look at inheritance and the three different types of directives 2 00:00:10,440 --> 00:00:13,060 we've already touched on the concept of inheritance. 3 00:00:13,080 --> 00:00:19,290 And you've most likely by now realize that as with scope in a typical programming language an engine 4 00:00:19,290 --> 00:00:24,090 X context inherits configurations from its parent contexts. 5 00:00:24,580 --> 00:00:30,440 This is generally a very straightforward top to bottom inheritance starting at the main context. 6 00:00:30,460 --> 00:00:39,050 The file itself down to that HTP context then the server context and finally any location context. 7 00:00:39,250 --> 00:00:45,400 That said Inheritance isn't always the straight forward and will vary depending on the type of directive 8 00:00:45,430 --> 00:00:49,090 being inherited from the three main directive types. 9 00:00:49,090 --> 00:00:54,480 Is this standard directive the array directive and the action directive. 10 00:00:54,520 --> 00:00:57,530 Now I won't be demonstrating the different types of directives. 11 00:00:57,550 --> 00:01:04,210 As I've previously done with small configuration changes but rather I compiled the sample configuration 12 00:01:04,240 --> 00:01:08,680 with detailed comments explaining how each directive works. 13 00:01:08,680 --> 00:01:11,490 So let's go over that first up. 14 00:01:11,500 --> 00:01:15,510 No one here we have what's called an array type directive. 15 00:01:15,700 --> 00:01:22,270 This is a directive that can be declared multiple times without overriding the previous the axis log 16 00:01:22,300 --> 00:01:28,810 being the perfect example of an array directive array directive sets inherited straight down meaning 17 00:01:28,870 --> 00:01:35,120 all child contexts of this main context will share these log file settings. 18 00:01:35,230 --> 00:01:37,860 For example the server context here. 19 00:01:38,570 --> 00:01:42,930 If I were ever a child context redeclare is this directive at all. 20 00:01:42,950 --> 00:01:48,000 So even only once the parent directive gets overridden completely. 21 00:01:48,260 --> 00:01:53,030 As would be the case here in this site to dot com server context. 22 00:01:53,030 --> 00:02:00,530 This entire context and all it's child context so these locations will have access logs completely disabled. 23 00:02:00,590 --> 00:02:04,610 Unless of course one of these child contexts declares its own access log. 24 00:02:04,670 --> 00:02:06,880 Again and so on. 25 00:02:06,890 --> 00:02:10,620 Then secondly we have this standard directive. 26 00:02:10,670 --> 00:02:16,190 This being the most common directive type and can only be declared once in a given context. 27 00:02:16,190 --> 00:02:22,640 Inheritance working exactly the same as the array directive parent to child with the child being able 28 00:02:22,640 --> 00:02:25,410 to override it with its own declaration. 29 00:02:25,760 --> 00:02:30,390 And finally the third directive type is the action directive. 30 00:02:30,590 --> 00:02:38,090 This being directives that invoke some or other break or action in the configuration for example a redirect 31 00:02:38,150 --> 00:02:46,250 via the return directive a response such as this one also via the return directive or alternatively 32 00:02:46,250 --> 00:02:50,830 a rewrite from either a rewrite or try files directive. 33 00:02:51,110 --> 00:02:57,320 Inheritance simply does not apply to action directives as they stop the normal flow of the configuration. 34 00:02:57,930 --> 00:03:03,450 That covers the three types of directives and the basics of inheritance which again is very important 35 00:03:03,450 --> 00:03:04,510 to understand. 36 00:03:04,620 --> 00:03:08,570 So be sure to download this linked configuration file for reference.