Exercises, examples and other material relating to training module A604. This topic is presented on public courses Deploying Apache and Tomcat
, Deploying Java Applications on Linux / Unix
How to use Apache httpd to host more than one
web site on a single server. With just one copy of
httpd, you can serve hundreds of sites!
Related technical and longer articlesMultiple domains on a single web server
|Articles and tips on this subject||updated|
|4404||Which (virtual) host was visited? Tuning Apache log files, and Python analysis|
We host a number of domains on our main server, and in order to avoid fragmentation of log files, we keep a sinle composite log. Rather than use a standard logfile format henceforth, I've changed the second field to carry the virtual host name accessed for the request, as that was missing up until this ...
|3568||Telling which ServerAlias your visitor used - useful during merging domains|
Someone tells you a website to visit - "go to wellhousemanor.co.uk" they say. And you'll naturally add "www." in front of it, calling up www.wellhousemanor.co.uk rather than wellhousemanor.co.uk ... or perhaps you won't.
Web servers are normally set up by default to respond to a single specific host ...
|3132||Virtual Hosting with Apache http server - an overall scheme, and avoiding common pitfalls|
During many of our courses, I write code snippet examples and add them to our website so that the delegates can refer back to them later - and they also form an ongoing resource for others who happen to be looking for examples. But on our Linux Web Server (LAMP) courses, there's far less original code ...
|1896||Virtual Hosts and Virtual Servers|
Do you want to use a single computer to host many different web sites? There are no less than four quite common ways of doing this - each of which has its advantages and disadvantages.
At the top left of my diagram, you have virtual hosting. In this arrangement, all the domains hosted on a single ...
|1687||Virtual Hosting on Apache httpd - a primer example|
A single web server computer, running a single Apache httpd daemon, can serve many domains through virtual hosting - usually "named virtual hosting" which allows a single IP address to be used for all the different domains.
Here is how it works ...
• you set up all your defaults in the main httpd.conf ...
|690||Adding Virtual Hosts|
If you're running your own server and want to look after multiple domains, you can easily do so using Apache httpd's Virtual Hosting. It's as easy as 1-2-3-4 ...
1. Create new host names in your DNS
2. Create home directories and a test index.html
3. Set up virtual hosts in httpd.conf (redhat) or vhosts.xxxx.conf ...
Examples from our training material
Some modules are available for download
as a sample of our material or under an Open Training Notes License
for free download from http://www.training-notes.co.uk
Topics covered in this module
Setting up so the browser can see multiple hosts
Configuring virtual hosts
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule
Well House Consultants specialise in training courses in
Linux and LAMP
. We run
throughout the UK (and beyond for longer courses), and
at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if you live in a different
country or continent to us
We have a technical library of over 700 books on the subjects on which we teach.
These books are available for reference at our training centre. Also
available is the Opentalk
Forum for discussion of technical questions.