There are several ways of doing this. Making subdomains are maybe the most widespread. But I found this much easier – and intuitive 🙂

First, I added a couple of new hosts in /etc/hosts localhost alpha beta gamma

In /var/www, I added the folders alpha, beta, gamma containing index.php

<?php echo getcwd(); ?>

Then I added a new site in /etc/apache2/sites-availabe/

sudo nano greek
# alpha
	DocumentRoot /var/www/alpha/
# beta
	DocumentRoot /var/www/beta/
# gamma
	DocumentRoot /var/www/gamma/

And finished of with:

sudo a2ensite greek
sudo /etc/init.d/apache2 reload

firefox alpha now showed /var/www/alpha

This was first published here.