Forum Moderators: phranque

Message Too Old, No Replies

Virtual Host

Always serves the same directory regardless and pages

         

littleOne

7:24 am on Feb 6, 2006 (gmt 0)

10+ Year Member



Hi,

Problem: I am setting up a few subdomains and using apache virtual host to direct to the right place.

Here is my virtual host config:

Port 80
NameVirtualHost 111.111.111.111
ServerName www.site.com

<VirtualHost *>
ServerName www.site.com
DocumentRoot /www/htdocs
</VirtualHost>

<VirtualHost *>
ServerName www.sub.site.com
DocumentRoot /www/sub
</VirtualHost>

I have used my real domain name and ip in the config file. However by going to sub.site.com it doesnt use the site inside the sub folder.

It always serves /www/htdocs when requesting a page with the url sub.site.com

Is there something I am missing?

gizard

12:31 pm on Feb 6, 2006 (gmt 0)

10+ Year Member



Try
==============
Port 80
NameVirtualHost 111.111.111.111
ServerName www.site.com

<VirtualHost *>
ServerName www.site.com
DocumentRoot /www/htdocs
</VirtualHost>

<VirtualHost *>
ServerName sub.site.com
DocumentRoot /www/sub
</VirtualHost>
==============
Then connect to:
[sub.site.com...]