Welcome to WebmasterWorld Guest from 54.162.213.67

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

main server -vs- virtual host

all 4 dns names bring me to main server

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

New User

10+ Year Member

joined:Jan 17, 2004
posts:16
votes: 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>

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

Senior Member

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

joined:Mar 31, 2002
posts:25430
votes: 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

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

Preferred Member

10+ Year Member

joined:Apr 7, 2003
posts:540
votes: 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

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

New User

10+ Year Member

joined:Jan 17, 2004
posts:16
votes: 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

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

New User

10+ Year Member

joined:Jan 17, 2004
posts:16
votes: 0


Ok bunlt tried your suggestion...same results in explorer and netscape,,,,Safari works fine ,,,,?
Thank You for trying :)
3:54 am on Jan 18, 2004 (gmt 0)

Preferred Member

10+ Year Member

joined:Aug 1, 2003
posts:392
votes: 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:15 pm on Jan 18, 2004 (gmt 0)

New User

10+ Year Member

joined:Jan 17, 2004
posts:16
votes: 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