Now, the question is why we created the index.php as a default page for your php code.
So for that, we have to understand that we have to go into this cd /etc/httpd/ directory because all the files are there.
Then we will run this tree command, in tree command.
We will find that many files are there in conf directory.
httpd.conf is there, bak file it there, then in conf.
directory, we have got one file that is php.conf.
So that file is important for us.
So then we will open with a cat or head command this file, which is in your conf.d directory.
php.conf file, here we are going to find one parameter DirectoryIndex index.php.
So that is why we created the file, because when we run the Apache Web server, it reads the httpd.
conf file.
Then it reads one include directive, in include directive all the files in this directories are read.
So what happens automatically
This file also get read.
So this DirectoryIndex index.php get activated.
this directive.
That is why we created, the DirectoryIndex directive will decide which files will be searched in what order to be
delivered to web clients. The "index.php" is included in the directive.
that is why we created the main file with name "index.php".
Let us go into our master server first.
What we are going to do, we will go into /etc/httpd
Then we are going to run tree very useful command.
It is showing us the whole directory structure.
So here we have got one important file is there php.conf.
So what we are going to do, we can open it with the cat command.
also conf.d and file name is php.conf and this is very large file.
So when we are going to open this, it is showing one option.
That is DirectoryIndex option.
this is why we have created this file.
Now you can view this file what you can.
If you want to view a few lines.
So what we can specify, we can specify this command also.
Head - line you want to display, so it is showing us the DirectoryIndex, and that is why we created
that by default.
We created that index.php file.
That was the reason.