I'll take a crack at it.
For this example, I'll use 64.1.2.3 as the IP,
www.example.com and
www.foobar.com as the domains.
Make sure "www.example.com" resolves to 64.1.2.3
Make sure "www.foobar.com" resolves to 64.1.2.3 too
Test it from your home computer using "nslookup
www.example.com" and "nslookup
www.foobar.com". The domains must be resolving to your IP to do named-based virtual hosts.
Edit your apache.conf/httpd.conf file (usually in /etc/apache or /etc/httpd/conf/). Here's some examples:
Code:
...
Port 80
ServerName li-3.members.linode.com
DocumentRoot /var/www/html
NameVirtualHost *
<VirtualHost *>
DocumentRoot /www/example.com
ServerName www.example.com example.com
...
</VirtualHost>
<VirtualHost *>
DocumentRoot /www/foobar.com
ServerName www.foobar.com foobar.com
...
</VirtualHost>
This would serve three sites. The linode's default address would be served out of /var/www/html. Requests to "www.example.com" would be served out of /www/example.com, and foobar.com out of /www/foobar.com.
Check out
http://httpd.apache.org/docs/vhosts/examples.html
Apache is very flexible. It will do what you tell it
-Chris