Page 1 of 1

Name Based Virtual Hosts

PostPosted: 16. November 2004 20:44
by scrumpers
I have apachefiends running my guest house website under http and https but cannot get any name based vitual hosts working I add a section to the

<VirtualHost *>
DocumentRoot d:\apachefriends\xampp\htdocs\mydomain.co.uk
ServerName www.mydomain.co.uk
</VirtualHost>

but it stops all my sites working I get an error on start up stating using * ports and non-* ports with a name virtual host is unsupported

Any help would be appreciated

Easy to fix

PostPosted: 16. November 2004 20:58
by taustin
Had the same thing. The basic issue is that the default set up for SSL (which is in ssl.conf, in the same directory as httpd.conf) sets Apache to listen on port 443 for SSL, which means all your virtual hosts need to be told to listen only on specific ports.

If you don't need to mess with the SSL stuff, the quick fix is:

Uncomment this line (just above the first VirtualHost setting)

NameVirtualHost *:80

(make sure it's got the *:80 at the end)

Then, make each VirtualHost tag look like this:

<VirtualHost *:80>

This tells Apache to only listen on port 80.

If you need to use SSL, look at
http://community.apachefriends.org/f/viewtopic.php?t=7614&highlight=ssl