...

View Full Version : Virtual hosts and domains



ole90
02-20-2011, 07:53 PM
Hey guys,

I have a server and want to host multiple domains on it. I've looked around google and apache docs and I need to create Virtual Hosts. So I went ahead and did that but I'm getting a problem.

I've setup two virtualhosts:

<VirtualHost 204.12.227.99>
DocumentRoot /home/ole/public_html
ServerName wispengine.com
<Directory /home/ole/public_html>
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost 204.12.227.99>
DocumentRoot /home/ole/public_html/vwc
ServerName virtualworldscommunity.com
<Directory "/home/ole/public_html/vwc">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

Now wispengine.com works fine, but virtualworldscommunity.com instead of pointing to the subfolder home/ole/public_htm/vwc/ it points to home/ole/public_html like the wispengine.com virtual host.

Any help?

ecco
02-28-2011, 01:39 AM
You would need two different IP addresses for that setup to work. You want to use NameVirtualHost.




NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /home/ole/public_html
ServerName wispengine.com
<Directory /home/ole/public_html>
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /home/ole/public_html/vwc
ServerName virtualworldscommunity.com
<Directory "/home/ole/public_html/vwc">
allow from all
Options +Indexes
</Directory>
</VirtualHost>


or you could just add the line:

NameVirtualHost 204.12.227.99

above your virtualhost entries and that should work too...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum