Help with multiple sites configuration.

This is a discussion on Help with multiple sites configuration. within the Apache Web Server forums, part of the Web Server and Related Forums category; Greetings, I'm hosting two sites from a single (Win2k) machine running Apache 1.3.31. Both sites are e107 ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-04-2006
blake@kingdomrpg.com
 
Posts: n/a
Default Help with multiple sites configuration.

Greetings,

I'm hosting two sites from a single (Win2k) machine running Apache
1.3.31. Both sites are e107 powered. And mostly this works.

But sometimes (and quite often for some people), typing in one
domain in the address bar results in getting the other site. I'm sure
I'm missing something in my config file, but I don't know what, and
I'm sort of trouble because I want to put up a third site, but not if
it's going to increase the confusion.

Since things generally work, I'm disinclined to change much, but I do
look at that 1.3.31 version thing suspiciously. (There's a reason I'm
using that; lack of support for some other aspect of the sites, can't
remember which.) Anyway, here's the passage in question, in case I'm
missing something.

<VirtualHost *:80>
ServerAdmin blake@loadedshelf.com
DocumentRoot "c:/loadedroot"
ServerName www.LoadedShelf.com
ServerAlias *.LoadedShelf
ErrorLog logs/ls-error.log
ScriptAlias /cgi-bin/ "c:/loadedroot/cgi-bin/"
<Directory "c:/loadedroot">
Options All Includes Indexes
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerAdmin blake@kingdomrpg.com
DocumentRoot "c:/webroot"
ServerName www.KingdomRPG.com
ServerAlias *.Kingdomrpg
ErrorLog logs/krpg-error.log
ScriptAlias /cgi-bin/ "c:/webroot/cgi-bin/"
<Directory "c:/webroot">
Options All Includes Indexes
</Directory>
</VirtualHost>

Thanks for any thoughts.

  #2 (permalink)  
Old 12-04-2006
HansH
 
Posts: n/a
Default Re: Help with multiple sites configuration.

<blake@kingdomrpg.com> schreef in bericht
news:1165210667.849416.234520@j44g2000cwa.googlegr oups.com...
> But sometimes (and quite often for some people), typing in one
> domain in the address bar results in getting the other site. I'm sure
> I'm missing something in my config file, but I don't know what, and
> I'm sort of trouble because I want to put up a third site, but not if
> it's going to increase the confusion.


Assuming there is a 'NameVirtualHost *:80' upfront, I just wonder why
ServerAlias *.LoadedShelf
ServerAlias *.Kingdomrpg
are missing the .com suffix ...
AFAIK the wildcard prefix is invalid too, you have to list all resolvable
prefixes:
ServerAlias abc.loadedshelf.com 123.loadedshelf.com etc.loadedshelf.com
Your DNS is NOT setup with a true wildcard, so the list is likely very
short.

Commonly on virtualhosts if things go wrong, requests for any site show the
first one.
This is *name based* vhost-ing and the request's host header is to provide
that name to match the Servername of a ServerAlias.
If this header is missing or matching none and there is no <virtual host
_default_:80> defined, the first defined virtualhost kicks in and responds.
Lack of this header will occor if you are addressed by http://24.199.62.2 or
when your site is accessed through a stricked HTTP/1.0 proxy.

If needed to further investigation will need some extra logging outside the
vhosts
SetEnvIfNoCase HOST !"." extra
SetEnvIfNoCase HOST !"24.199.62.2" extra
SetEnvIfNoCase X-FORWARDED-FOR "." extra
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"
%{HOST}i %{X-FORWARDED-FOR}i" extra
CustomLog logs/extra_log extra env=extra

The extra_log will only show requests without a host header, your ip as host
*name* or when a proxy has forwarding the ip of the upstream requestor.

HansH


  #3 (permalink)  
Old 12-04-2006
Mark
 
Posts: n/a
Default Re: Help with multiple sites configuration.

"HansH" <hansh@invalid.invalid> wrote in
news:4573dc6f$0$326$e4fe514c@news.xs4all.nl:

> Assuming there is a 'NameVirtualHost *:80' upfront, I just wonder why
> ServerAlias *.LoadedShelf
> ServerAlias *.Kingdomrpg
> are missing the .com suffix ...
> AFAIK the wildcard prefix is invalid too, you have to list all
> resolvable prefixes:
>


I fully agree with Hans here, and would add a suggestion. Anytime you
have virtual hosts be sure your main server (not the virtual host config)
in not defined. Instead, create a third virtual host placed in front of
all your other virtual hosts as an 'error catch-all' v-host. That way you
do not show a wrong website, you admit that an error has occurred and the
intended website in not available at this time.

Just my 2 pence.

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
  #4 (permalink)  
Old 12-04-2006
HansH
 
Posts: n/a
Default Re: Help with multiple sites configuration.

"Mark" <mtaylor*@*lrim.com> schreef in bericht
news:1165229954_40709@sp6iad.superfeed.net...
> "HansH" <hansh@invalid.invalid> wrote in
> news:4573dc6f$0$326$e4fe514c@news.xs4all.nl:
>
>> Assuming there is a 'NameVirtualHost *:80' upfront, I just wonder why
>> ServerAlias *.LoadedShelf
>> ServerAlias *.Kingdomrpg
>> are missing the .com suffix ...
>> AFAIK the wildcard prefix is invalid too, you have to list all
>> resolvable prefixes:
>>

>
> I fully agree with Hans here, and would add a suggestion. Anytime you
> have virtual hosts be sure your main server (not the virtual host config)
> in not defined. Instead, create a third virtual host placed in front of
> all your other virtual hosts as an 'error catch-all' v-host. That way you
> do not show a wrong website, you admit that an error has occurred and the
> intended website in not available at this time.
>

I even prefer to make it independent to the order of configuration and
*name* it
<virtual_host _default_:80> ... </virtual_host>
(While using an include 'vhost/*.conf' OS sorting order may vary and break
the intent, but when named this way )
In fact I dislike serveraliasses so much, I have some mapped rewrites in
there to redirect *.domain.tld to www.domain.tld. Even domian.tld or
domane.tld is put on the right track that way ... nifty list of 10 domains
times avg 5 speling bugs ;-)
It keeps me from hassling with domain cookies and as a bonus google will not
report double content...

HansH



  #5 (permalink)  
Old 01-15-2007
blake@kingdomrpg.com
 
Posts: n/a
Default Re: Help with multiple sites configuration.

Sorry, didn't meant to leave this hanging.

Thanks for all the advice. I'm attempting to implement the suggestions
now.

===Blake===

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:20 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0