Now, in when we are implementing any server then reading log file is very important.
So in the case of apache also, two main log files are maintain.
One is /var/log/httpd/access_log.
And second is your error_log.
now, Apache web server keeps log files and error file in which directory /var/log/httpd directory.
You can view the access_log by viewing /var/log/httpd/access_log file and error_log by viewing your
/var/log/httpd/error_log file.
These files are going to give you very useful information which can be very useful for troubleshooting
purposes and log files are maintained in your common log format, which is standard text log format.
If the log files are in this format, you can use many external tools for analyzing the log files.
So when we view this log file, we are just viewing the last one line tail -1 mean just
displayed the last one line access_log.
It will give you the information from where we assess the server, on which date we access what was
the request.
And in error_log, it is going to give you the error.
Like in our case, when we did not change the home directory permission denied access was there.
So log files will give you very useful information what is happening who try to access at which
time.
So very useful.
So let us go to the master and let us check which log files are there.
So we will logging in as the root user because only root users can view these log files.
So first we will view tail -1
/var/log/httpd/access_log.
So it is showing you that nanu user was able to access by using the name and that specifying by using
that name, if we are going to use if we are going to say display two lines, then it is showing the
access by your IP address also.
Let us show you the whole last 10 lines, then let us see what is happening.
So it is giving you a lot of information.
That means when we accessed by the IP address, it is showing that also and when we accessed by the
name, it is showing that also.
And what about the error log file?
You can view with this tail command, it is again showing you last ten lines, so it showing you permission
deny errors.
So a lot of information you can find in by viewing this as access_log and as as a error_log file, in error log
file error, permission deny type message is there, in the case of access
it will note down who had successfully able to access our webserver.
So that information is also very important.
And if we are going to view it, we can view last one line also so we can specify -1.
So it is showing you this permission deny error.
So that was our how we have implemented our per user web directory concept.
This is very important concept.
So that was our structure that mean we can access the web pages of the user by using this command or
by using this command.
And every user can launch their own website by using their home directory.
So that was the whole purpose of this set of videos.