1
00:00:00,870 --> 00:00:06,100
Now, in when we are implementing any server then reading log file is very important.

2
00:00:06,390 --> 00:00:12,440
So in the case of apache also, two main log files are maintain.

3
00:00:12,450 --> 00:00:15,900
One is /var/log/httpd/access_log.

4
00:00:16,050 --> 00:00:17,760
And second is your error_log.

5
00:00:18,270 --> 00:00:23,590
now, Apache web server keeps log files and error file in which directory /var/log/httpd directory.

6
00:00:23,880 --> 00:00:31,860
You can view the access_log by viewing /var/log/httpd/access_log file and error_log by viewing your

7
00:00:32,130 --> 00:00:34,800
/var/log/httpd/error_log file.

8
00:00:35,010 --> 00:00:42,540
These files are going to give you very useful information which can be very useful for troubleshooting

9
00:00:42,540 --> 00:00:49,860
purposes and log files are maintained in your common log format, which is standard text log format.

10
00:00:51,750 --> 00:00:59,200
If the log files are in this format, you can use many external tools for analyzing the log files.

11
00:00:59,700 --> 00:01:07,860
So when we view this log file, we are just viewing the last one line tail -1 mean just

12
00:01:07,860 --> 00:01:10,280
displayed the last one line access_log.

13
00:01:10,560 --> 00:01:18,390
It will give you the information from where we assess the server, on which date we access what was

14
00:01:18,390 --> 00:01:19,140
the request.

15
00:01:19,650 --> 00:01:23,220
And in error_log, it is going to give you the error.

16
00:01:23,640 --> 00:01:30,140
Like in our case, when we did not change the home directory permission denied access was there.

17
00:01:30,510 --> 00:01:38,010
So log files will give you very useful information what is happening who try to access at which

18
00:01:38,010 --> 00:01:38,330
time.

19
00:01:38,580 --> 00:01:39,590
So very useful.

20
00:01:39,900 --> 00:01:47,100
So let us go to the master and let us check which log files are there.

21
00:01:47,670 --> 00:01:54,380
So we will logging in as the root user because only root users can view these log files.

22
00:01:55,140 --> 00:02:00,300
So first we will view tail -1

23
00:02:01,710 --> 00:02:07,410
/var/log/httpd/access_log.

24
00:02:09,160 --> 00:02:18,430
So it is showing you that nanu user was able to access by using the name and that specifying by using

25
00:02:18,430 --> 00:02:28,930
that name, if we are going to use if we are going to say display two lines, then it is showing the

26
00:02:29,380 --> 00:02:32,750
access by your IP address also.

27
00:02:32,920 --> 00:02:39,080
Let us show you the whole last 10 lines, then let us see what is happening.

28
00:02:40,570 --> 00:02:43,630
So it is giving you a lot of information.

29
00:02:43,630 --> 00:02:48,790
That means when we accessed by the IP address, it is showing that also and when we accessed by the

30
00:02:48,790 --> 00:02:50,410
name, it is showing that also.

31
00:02:51,130 --> 00:02:52,850
And what about the error log file?

32
00:02:53,980 --> 00:03:03,290
You can view with this tail command, it is again showing you last ten lines, so it showing you permission

33
00:03:03,290 --> 00:03:05,720
deny errors.

34
00:03:06,010 --> 00:03:13,810
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

35
00:03:13,810 --> 00:03:21,620
file error, permission deny type message is there, in the case of access

36
00:03:22,690 --> 00:03:27,570
it will note down who had successfully able to access our webserver.

37
00:03:27,760 --> 00:03:29,970
So that information is also very important.

38
00:03:30,400 --> 00:03:38,140
And if we are going to view it, we can view last one line also so we can specify -1.

39
00:03:39,250 --> 00:03:42,690
So it is showing you this permission deny error.

40
00:03:43,090 --> 00:03:50,150
So that was our how we have implemented our per user web directory concept.

41
00:03:50,170 --> 00:03:52,290
This is very important concept.

42
00:03:52,690 --> 00:04:02,620
So that was our structure that mean we can access the web pages of the user by using this command or

43
00:04:02,620 --> 00:04:03,700
by using this command.

44
00:04:03,970 --> 00:04:09,540
And every user can launch their own website by using their home directory.

45
00:04:09,610 --> 00:04:14,170
So that was the whole purpose of this set of videos.
