Jump to content
The Uniform Server Community
Sign in to follow this  
yhuynh

Virtual hosts keep going to root

Recommended Posts

I have set up my virtual hosts like so:

 

NameVirtualHost *

 

<VirtualHost *>

ServerName localhost:80

DocumentRoot /www

</VirtualHost>

 

<VirtualHost *>

ServerName yemmer

DocumentRoot /www/yemmer

</VirtualHost>

 

However, what i notice is that if i go to:

 

http://yemmer

 

it takes me to /www and not /www/yemmer

 

I have searched through the forums here and haven't found articles related to this problem. Does anyone know what is causing this?

 

I'm on Windows XP.

 

Also my C:/WINDOWS/system32/drivers/etc/hosts file has this:

 

127.0.0.1 localhost

127.0.0.1 localhost:80

 

127.0.0.1 yemmer

 

which looks right.

Share this post


Link to post
Share on other sites

yhuynh,

 

Your configuration is the same as mine (XP, hosts, httpd.conf) except that I have used a fake domain name (ie.; yemmer.com ) in hosts and the httpd.conf files. I don't see where this would make any difference, but I note it.

 

I also see you have localhost:80 UNCOMMENTED as a virtual host in httpd.conf THIS MAY BE THE PROBLEM... I have it commented out in my httpd.conf (see below)

 

Do you have a valid html file in the root? index.php, .html etc?

 

Localhost is the default choice in httpd.conf and so it will be presented when apache cannot find the specified domain. That's why localhost:80 is first in the list in httpd.conf.

 

I do NOT have localhost (without the port 80) specified in httpd.conf. Look around line 278 for "servername localhost:80". Here's my configuration for comparison, all of which is working:

 

HOSTS example

127.0.0.1 localhost

127.0.0.1 localhost:80

127.0.0.1 GadgetsforGold.Com

127.0.0.1 StopBrite.com

#127.0.0.1 TWPMarket.ing

127.0.0.1 TWPMarketing.com

127.0.0.1 UGM.com

127.0.0.1 cimyadmin.ing

 

HTTPD.CONF example

#<VirtualHost *>

# ServerName localhost:80

# DocumentRoot /www

#</VirtualHost>

 

##########VIRTUAL HOST SETUP##########

# GADGETSFORGOLD

<VirtualHost *>

ServerName GadgetsForGold.com

DocumentRoot /www/gfg

</VirtualHost>

# TWPMARKET.ING

<VirtualHost *>

ServerName TWPMarket.ing

DocumentRoot /www/twping

</VirtualHost>

# TWP MARKETING

<VirtualHost *>

ServerName TWPMarketing.com

DocumentRoot /www/twp

</VirtualHost>

# STOPBRITE

<VirtualHost *>

ServerName Stopbrite.com

DocumentRoot /www/sb

</VirtualHost>

# UG_Maint

<VirtualHost *>

ServerName UGM.com

DocumentRoot /www/ugm

</VirtualHost>

<VirtualHost *>

ServerName cimyadmin.ing

DocumentRoot /www/CIMyAdmin

</VirtualHost>

Hope this helps

TWP

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...