Web Hosting Talk







View Full Version : Problem with virtualhosts


roggo
06-15-2004, 04:33 AM
hi,

i'm wondering how to structure my <VirtualHost> tag in my httpd.conf file

here's what ive got at the minute:C:

NameVirtualHost *

<VirtualHost *>
ServerName www.fivebyte.com
DocumentRoot /www/sites/fivebyte/
</VirtualHost>


wnd when i type www.fivebyte.com i my browser, it takes me to the index of my main server, instead of the area designated by the <VirtualHost> tag... :confused:

Any help??

pergesu
06-15-2004, 06:46 AM
My guess is that you just haven't reloaded the Apache configuration. At the command line, type

apachectl graceful

to restart Apache. Additionally, you'll want a ServerAlias directive in there for fivebytes.com. The way you've got it set up, requests to www.fivebytes.com will work fine, but requests to fivebytes.com will get a "No site configured at this address" type of error from Apache. So underneat the ServerName, add the line
ServerAlias fivebytes.com

and restart Apache, and it should work fine.

Bashar
06-15-2004, 06:50 AM
<VirtualHost *>
should be
<VirtualHost 123.123.123.123>

replace 123.123.123.123 with your main server IP

u can also use
NameVirtualHost 123.123.123.123:80

Samuel
06-15-2004, 06:53 AM
I get this http://www.fivebyte.com/sites/fivebyte/index.php Pergesu, you have it plural

roggo
06-15-2004, 11:01 AM
ok, i sorted it lol, thanks for all your advice and tips!

heres the overall VirtualHost tag:

<VirtualHost 81.99.147.48>
ServerName www.fivebyte.com
ServerAlias fivebyte.com
DocumentRoot "C:/as/www/sites/fivebyte/"
</VirtualHost>

Thanks Again
Roggo :D

Bashar
06-15-2004, 04:48 PM
glad you got it solved :D

most welcome.