Now we need to make the appropriate changes in our httpd.config file, which is a apache configuration
file.
So we will again make three virtualhost entries.
First, virtualhost entry will be VirtualHost 172.24.0.1.
What will be the ServerName, ServerName will be 172.24.0.1.
And it is going to serve the material from /var/www/html/example1 directory and then we will close this stanga.
Then second virtualhost, we are going to launch on 172.24.0.2 and we are saying that please assume
that ServerName is 172.24.0.2 and we are going to specify from where to serve the material.
In our case, it is going to be example2.com.
We will close this VirtualHost directive then third
whole section 172.24.0.3 and ServerName is going to be 172.24.0.3 and from where we
want to serve from example3, that mean we have to just create one section for each virtualhost.
And the setting should be the IP address on which we want to listen for the request.
And then from which directory, you are going to serve the material then just test the syntax whether
it is ok or not, and then reload the service.
And what is the meaning of this stanga?
This section
The first parameter is the start of virtual host section for 172.24.0.1.
Then here it is going to contain your server IP, then here from where the content will be served.
And this is the end of section.
And please remember in the case of a name based virtual hosting, it was listening on the same.
ip address mean here it was one one one.
And here instead of IP addresses there, we were specifying the name.
So this is the main configuration difference between your name based and IP based.