UBUNTU APACHE EXAMPLE VIRTUAL HOSTS
/etc/apache2/sites-available/default
ServerName domain.com
ServerAlias www.domain.com
DocumentRoot /www/docs/host.foo.com
ErrorLog logs/host.foo.com-error_log //ensure that the log files have the right permissions
TransferLog logs/host.foo.com-access_log // chmod 644 host.foo... chown apache:apache host.foo...
ErrorDocument 404 /messages/404.html //custom error messages, file not found
ErrorDocument 500 /messages/500.html //script fails to load
//just add a new virtualhost block for each new domain or subdomain that you want to host //just add another ServerAlias line for each name that you want a particular virtualhost //block to resolve
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
Virtual hosts allows multiple websites to be hosted on the same server differentiated by DNS names - not unique ip addresses