The term Virtual Host refers to the practice of running more than one website (such as department1.company.com and department2.company.com) on a single machine. Virtual hosts can be “IP-based”, it means that we have a different IP address for every website and “Name-based”, means that we have multiple names running on each IP address. The fact that they are running on the same physical server is not apparent to the end user.
There are two types of Apache virtual host configurations:
In this configuration, when you are indicating two websites (with different IP-address) to the server that runs Apache, that physical server should have two different IP-address configured.
This means that the server should have two ethernet cards, each one of them configured to the IP-address of the corresponding website that Apache virtual host will be serving. But it’s not practical when you are serving a large number of websites.
Recommended Post: How to Install Laravel – Steps to be Followed
In this configuration, when Apache web server receives a request, it looks for the hostname in the HTTP header and depending on the hostname, it serves different websites. This is very easy, as you need only one IP-address on that physical server, but, you update the DNS with multiple website names specifying to the same IP-address.
We will read more about Virtual Host in coming blog because the focus of this blog is how to set up Virtual host for Laravel.
This is how you can set up virtual host in your xamp or wamp server for laravel.
I hope you have enjoyed these simple steps and if you have any problems, please feel free to post your queries in the comment section below.