How to Host Multiple Websites on Apache

A pdf version of this posting can be downloaded here.

Introduction:

Websites, in all their different forms, are hosted on web servers and the Apache web server is one of the most popular currently available.  It would be incredibly inefficient to only host one website per server, particularly in a commercial web hosting scenario, but for designers and developers at any level there is often a need to work on different sites, or different versions of the same site, in the same environment. In order to make the most of your resources the logical approach is to host multiple sites on one installation of Apache server.

On Apache each website is treated as a Virtual Host, with the concept of hosts relating to how DNS is configured in order to route traffic to a website. When a web browser requests a website via a URL the request is handled by DNS which knows that, for example, http://www.somesite.com relates to a specific IP address – the address of the server that’s hosting the site. DNS forwards the traffic to the server which in turn responds with the information requested. As far as DNS is concerned the URL of the website bound to a specific IP address is just another host in its database.

Continue reading “How to Host Multiple Websites on Apache”

Advertisements
How to Host Multiple Websites on Apache