reedsmith: Yes, you must set up a default VirtualHost. Any domain name that resolves to your IP and is not listed in a VirtualHost directive will default to the first one listed. This caused me some embarassment when I was hosting a small business and when my client left the www off of his URL, it defaulted to the first VH on my server, which happened to be a porno site! (Which is why you want to add ServerAlias *.domainname.com to each VH directive)
From the Apache docs:
Code:
For example, suppose that you are serving the domain www.domain.tld and you
wish to add the virtual host www.otherdomain.tld, which points at the same IP
address. Then you simply add the following to httpd.conf:
NameVirtualHost *
<VirtualHost *>
ServerName www.domain.tld
DocumentRoot /www/domain
</VirtualHost>
<VirtualHost *>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>
phz: First off, unless you have a specific reason for assigning other ports, don't do it. It'll only make it harder to reach your site if everyone has to append a port number to your URL.
Secondly, if you rename the /home/user1/html directory to /home/user1/public_html, then apache will serve the pages there to the URL
www.whatever.com/~user1. So you don't need the symlinks.
[edit] Or you can change the following section in httpd.conf:
Code:
<IfModule mod_userdir.c>
UserDir public_html
</IfModule>
to:
Code:
<IfModule mod_userdir.c>
UserDir html
</IfModule>
[/edit]
bobby sands: I think you need to use the 'NameVirtualHost *' (or 'NameVirtualHost xxx.xxx.xxx.xxx:80') directive, not NameServer xxx.xxx.xxx.xxx:80.
Enjoy!
--- Cerbere