0

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?

3

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!

  • 1
    It's also called host header redirection. – Jesse P. Feb 10 at 5:24
  • Thanks Jesse. Too many names for the same thing in this world... ;) – Brandon Spendlove Feb 11 at 11:00
  • 1
    Yep. Just wanted to point it out in case the OP was having a hard time figuring out what else it may be called. – Jesse P. Feb 11 at 11:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.