homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
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

10+ Year Member

Msg#: 887 posted 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 *>
ServerAdmin example1@example1.com
DocumentRoot Library/usr/home/example1.com/public_html
ServerName example1.com

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

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



WebmasterWorld Senior Member jdmorgan us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 887 posted 4:57 am on Jan 17, 2004 (gmt 0)


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!



10+ Year Member

Msg#: 887 posted 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?


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



10+ Year Member

Msg#: 887 posted 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?



10+ Year Member

Msg#: 887 posted 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 :)


10+ Year Member

Msg#: 887 posted 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.


10+ Year Member

Msg#: 887 posted 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!


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