1
00:00:00,390 --> 00:00:08,340
Now we have to edit the httpd.config file, and here we have to first add one directive NameVirtualHost

2
00:00:08,340 --> 00:00:15,090
mean on which IP address we want to launch the three sites, although a new version of Apache, like in our

3
00:00:15,090 --> 00:00:19,830
case, we are using 2.4 this directive is no longer needed.

4
00:00:20,190 --> 00:00:26,730
But again, for backward compatible, we are adding this directive so this directive will decide on which

5
00:00:26,730 --> 00:00:31,320
IP address we are going to launch the three name based websites.

6
00:00:31,950 --> 00:00:35,730
Then for three websites we are going to create three Stenga's.

7
00:00:36,420 --> 00:00:40,920
The first is VirtualHost 172.24.0.1.

8
00:00:40,950 --> 00:00:49,950
Let me first explain that mean the VirtualHost section is the first parameter that mean start of virtual host

9
00:00:49,950 --> 00:00:57,980
section for 172.24.0.1 and then here we are going to specify the ServerName, in ServerName.

10
00:00:58,320 --> 00:01:02,040
We are going to specify www.example1.com.

11
00:01:02,490 --> 00:01:04,970
That means the name of our website.

12
00:01:05,370 --> 00:01:11,370
Then we have to specify the DocumentRoot from where the content will be served.

13
00:01:11,700 --> 00:01:17,410
So in our case, for example1.com, we want to serve the material from /var/www/html

14
00:01:17,610 --> 00:01:28,980
example1 and then we have to end this section by placing this slash, so that mean we have created

15
00:01:28,980 --> 00:01:29,670
three stanga's.

16
00:01:29,700 --> 00:01:35,370
This is the virtualhost and ip address on which we want to launch 172.24.0.1.

17
00:01:35,730 --> 00:01:39,600
So ServerName is www.example1.com.

18
00:01:39,810 --> 00:01:42,020
And we want to serve from this directory.

19
00:01:42,690 --> 00:01:47,200
Then again, second site also will be launched on one ip address.

20
00:01:47,430 --> 00:01:55,590
So here the parameter is going to be same, now the ServerName is www.example2.com and from where

21
00:01:55,890 --> 00:02:05,790
we want to serve the material, we want to send the material from /var/www/html/example2

22
00:02:06,240 --> 00:02:15,150
directory then for the third again VirtualHost 172.24.0.1 and the ServerName is 

23
00:02:15,150 --> 00:02:16,970
www.example3.com.

24
00:02:17,340 --> 00:02:20,720
That means we are going to serve from example3 directory.

25
00:02:21,090 --> 00:02:28,170
So when the client is going to send the request on www.example1.com, the material will be served

26
00:02:28,170 --> 00:02:31,740
from this directory if the client is going to send the request.

27
00:02:31,750 --> 00:02:37,650
www.example2.com, apache Web server serve the material from this directory.

28
00:02:37,980 --> 00:02:45,690
And if the the request from www.example3.com, that will be served from this.

29
00:02:45,990 --> 00:02:54,660
So we have to make the changes that mean for every Web site we have to create one stanga

30
00:02:54,660 --> 00:02:58,020
for this section for each website.
