1
00:00:00,480 --> 00:00:09,180
Now, the question is why we created the index.php as a default page for your php code.

2
00:00:09,720 --> 00:00:19,370
So for that, we have to understand that we have to go into this cd /etc/httpd/ directory because all the files are there.

3
00:00:19,740 --> 00:00:22,860
Then we will run this tree command, in tree command.

4
00:00:22,870 --> 00:00:26,150
We will find that many files are there in conf directory.

5
00:00:26,160 --> 00:00:31,140
httpd.conf is there, bak file it there, then in conf.

6
00:00:31,380 --> 00:00:35,790
directory, we have got one file that is php.conf.

7
00:00:35,820 --> 00:00:37,890
So that file is important for us.

8
00:00:38,580 --> 00:00:46,890
So then we will open with a cat or head command this file, which is in your conf.d directory.

9
00:00:47,100 --> 00:00:53,520
php.conf file, here we are going to find one parameter DirectoryIndex index.php.

10
00:00:54,240 --> 00:01:01,560
So that is why we created the file, because when we run the Apache Web server, it reads the httpd.

11
00:01:01,580 --> 00:01:03,120
conf file.

12
00:01:03,480 --> 00:01:10,690
Then it reads one include directive, in include directive all the files in this directories are read.

13
00:01:11,310 --> 00:01:12,960
So what happens automatically

14
00:01:12,960 --> 00:01:15,010
This file also get read.

15
00:01:15,450 --> 00:01:21,150
So this DirectoryIndex index.php get activated.

16
00:01:21,300 --> 00:01:23,490
this directive.

17
00:01:24,030 --> 00:01:30,240
That is why we created, the DirectoryIndex directive will decide which files will be searched in what order to be

18
00:01:30,240 --> 00:01:34,100
delivered to web clients. The "index.php" is included in the directive.

19
00:01:34,320 --> 00:01:39,090
that is why we created the main file with name "index.php".

20
00:01:39,420 --> 00:01:43,710
Let us go into our master server first.

21
00:01:43,710 --> 00:01:52,220
What we are going to do, we will go into /etc/httpd

22
00:01:52,800 --> 00:01:55,680
Then we are going to run tree very useful command.

23
00:01:56,340 --> 00:01:58,580
It is showing us the whole directory structure.

24
00:01:58,950 --> 00:02:02,850
So here we have got one important file is there php.conf.

25
00:02:03,510 --> 00:02:07,170
So what we are going to do, we can open it with the cat command.

26
00:02:07,200 --> 00:02:16,470
also conf.d and file name is php.conf and this is very large file.

27
00:02:16,830 --> 00:02:20,100
So when we are going to open this, it is showing one option.

28
00:02:20,430 --> 00:02:22,320
That is DirectoryIndex option.

29
00:02:22,770 --> 00:02:26,020
this is why we have created this file.

30
00:02:26,550 --> 00:02:29,760
Now you can view this file what you can.

31
00:02:30,300 --> 00:02:32,490
If you want to view a few lines.

32
00:02:32,490 --> 00:02:36,990
So what we can specify, we can specify this command also.

33
00:02:39,070 --> 00:02:49,810
Head - line you want to display, so it is showing us the DirectoryIndex, and that is why we created

34
00:02:49,820 --> 00:02:51,530
that by default.

35
00:02:51,580 --> 00:02:53,910
We created that index.php file.

36
00:02:54,370 --> 00:02:55,390
That was the reason.
