homepage Welcome to WebmasterWorld Guest from 54.227.40.166
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
main server -vs- virtual host
all 4 dns names bring me to main server
appleman58




msg:1517062
 4:36 am on Jan 17, 2004 (gmt 0)

I have 4 dns names pointed at my IP. All 4 take me to www.example.com . I have all 4 in containers in the virtual host configuration. What am I doing wrong?

<VirtualHost *>
ServerAdmin example@example.com
DocumentRoot Library/Apache2/htdocs/sites/example/public_html
ServerName example.com
</VirtualHost>

<VirtualHost *>
ServerAdmin example1@example1.com
DocumentRoot Library/usr/home/example1.com/public_html
ServerName example1.com
</VirtualHost>

<VirtualHost *>
ServerAdmin example2@example2.com
DocumentRoot Library/usr/home/example2.com/public_html
ServerName example2.com
</VirtualHost>

<VirtualHost *>
ServerAdmin example3@example3.com
DocumentRoot Library/usr/home/example3.com/public_html
ServerName example3.com
</VirtualHost>

 

jdMorgan




msg:1517063
 4:57 am on Jan 17, 2004 (gmt 0)

appleman58,

Welcome to WebmasterWorld [webmasterworld.com]!

I hope one of our server-level configuration gurus will stop in and help you out. Things get a bit quiet here over the weekends, so it may be monday before we can get an authoritative answer for this and your other post.

We'll just hope it's not that long, but I wanted to roll out the welcome mat and say hello!

Jim

bunltd




msg:1517064
 5:24 am on Jan 17, 2004 (gmt 0)

Welcome to Webmaster World, appleman58.

I'll take a stab at this one...

Have you tried it this way, with your IP & the port?

<VirtualHost 123.45.89.67:80>

This might help: Apache 2.0 Virtual Hosts [httpd.apache.org]

LisaB

appleman58




msg:1517065
 5:43 am on Jan 17, 2004 (gmt 0)

Thanks for responding Jim, Found something strange...when I access them through Safari they all work fine...but when I access them through Explorer or Netscape all 4 addreses take me to the main server....
What is going on?

Appleman

appleman58




msg:1517066
 5:55 am on Jan 17, 2004 (gmt 0)

Ok bunlt tried your suggestion...same results in explorer and netscape,,,,Safari works fine ,,,,?
Thank You for trying :)

robho




msg:1517067
 3:54 am on Jan 18, 2004 (gmt 0)

Have you looked at the log file (access_log) to see if there is anything different in the way each browser is asking for the page? Is it identical apart from the agent string (and time), or is there some other difference?

One remote possibility is that the failing browsers have been set to use HTTP 1.0 rather than 1.1 and so do not send the host name (so no way to choose the right one), but I can't reproduce that type of problem with MSIE on Windows.

The actual config looks fine, I use basically the same (with Apache 1.3), works fine. I assume you have a "NameVirtualHost *" line somewhere earlier in the config.

appleman58




msg:1517068
 10:15 pm on Jan 18, 2004 (gmt 0)

To all that were so kind to respond:

Very simple solution. I failed to name ServerAlias. Now everything works fine. Next battle is getting CGI to work. Sometimes think im getting to old for this.

Thanks again all!

Appleman58

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved