Packet Tracer – Can Multiple Sites Be Hosted on the Same Web Server?

ciscopacket-tracer

so I have this simple network containing one pc and one web server that contains a site:

enter image description here

I can access a site hosted on the server from the pc using a web browser, however, I want to access two sites, I tried but I couldn't host another site on the same server, so I added another server to host the second site, like this:

enter image description here

However, what if I have a 100 sites, making a server for each one doesn't seem realistic.

So my Question is: How can I host multiple sites on the same server?

Best Answer

This is a common implementation with web servers, if you take a look at Apache which is extremely common to be used as a web server you can create a virtual host. You would normally specify a hostname that relates to the directory of the website on the server.

So if you wanted to configure 3 websites on a single server for 3 separate customers, the idea behind it would be something like:

companyA.com points to /var/www/companyA
companyB.com points to /var/www/companyB
companyC.com points to /var/www/companyC

I would look into some web servers such as Apache and Nginx if you would like to lab the concept on a virtual machine which could be fun and very educational!