Apache 1.3 vhost default entries...
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Web Servers on Unix and Linux > Apache 1.3 vhost default entries...




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Apache 1.3 vhost default entries...  
jtelep


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-20-05 10:51 PM

Hi,

I've just set up my first virtual host entries on my web server and
they are working great but I have noticed a rather annoying problem
that I hope someone can shed some light on.  I see that my web server
will respond to any host for my domain (existing or not) and I know
that your first vhost entry is your default entry (i.e. any time a host
is requested that isn't in the virtual host list this is the location
that the page is served from).  I know that there are some directives
in Apache though for setting up the server to respond differently for
each of these errors (something like the "asis" directive and using
"ErrorDocument" based on the different errors that could come about
(403, 404, 502, etc.)  I'm just trying to figure out how to set this
up.  I have looked for how-to's on this but can't find anything and it
looks like the information needed to perform this is scattered about
(not in any one place).  Can someone direct me on how to set this up
(or at least point me in the direction that might have this info more
easily accessible and available?

Thanks!






[ Post a follow-up to this message ]



    Re: Apache 1.3 vhost default entries...  
John Murtari


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-20-05 10:51 PM

"jtelep" <jtelep@telepkids.com> writes:

> Hi,
>
> I've just set up my first virtual host entries on my web server and
> they are working great but I have noticed a rather annoying problem
> that I hope someone can shed some light on.  I see that my web server
> will respond to any host for my domain (existing or not) and I know
> that your first vhost entry is your default entry (i.e. any time a host
> is requested that isn't in the virtual host list this is the location
> that the page is served from).  I know that there are some directives
> in Apache though for setting up the server to respond differently for
> each of these errors (something like the "asis" directive and using
> "ErrorDocument" based on the different errors that could come about
> (403, 404, 502, etc.)  I'm just trying to figure out how to set this
> up.  I have looked for how-to's on this but can't find anything and it
> looks like the information needed to perform this is scattered about
> (not in any one place).  Can someone direct me on how to set this up
> (or at least point me in the direction that might have this info more
> easily accessible and available?
>
> Thanks!
>

You may want to explain whether you are using IP based
virtual host or name based (sounds like you are using IP).  When
apache starts it does a reverse lookup on the names and generates
addresses for each.  A request coming into that address gets serviced
by that vhost block.   You say you are seeing default (base) pages
come up for hosts that don't exist?, i.e. bongo.mydomain.com

If that is getting though you must have some DNS information
loaded for that, maybe a default wild card in you db record.  Just
get rid of that (and define the hosts you truly want), and that
should take care of it.

Hope this helps.

--
John
 ________________________________________
___________________________
John Murtari                              Software Workshop Inc.
jmurtari@following domain 315.635-1968(x-211)  "TheBook.Com" (TM)
http://thebook.com/





[ Post a follow-up to this message ]



    Re: Apache 1.3 vhost default entries...  
jtelep


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-20-05 10:51 PM

You're right, I'm sorry.  I'm using name-based virtual hosts (only one
IP address) and, from what I understand, any host entry that's not
found in the virtual host block gets the default (first) vhost entry
(i.e. www.somedomain.com).






[ Post a follow-up to this message ]



    Re: Apache 1.3 vhost default entries...  
David Efflandt


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-21-05 01:47 AM

On 20 Jan 2005 09:45:51 -0800, jtelep <jtelep@telepkids.com> wrote:
> You're right, I'm sorry.  I'm using name-based virtual hosts (only one
> IP address) and, from what I understand, any host entry that's not
> found in the virtual host block gets the default (first) vhost entry
> (i.e. www.somedomain.com).

I have a dynamic IP (using no-ip.com dynamic DNS) and specifically want
any access that does not specify one of my set name vhosts to go to my
default dead end vhost (which logs those worms separate from other logs).
So for my main ServerName (outside of any vhosts) is specifically set to a
bogus name that does not resolve, and default vhost has no ServerName.
That is because I found that things did not work quite right if main
ServerName matched one of the vhosts.  So any Host header that does not
match one of my set vhosts falls into my default worm trap.

I use wildcard  NameVirtualHost *  along with  UseCanonicalName off  in
main part of config file, and wildcard <VirtualHost *> for all vhosts. All
vhosts other than default have ServerName or ServerAlias that applies to
that vhost.





[ Post a follow-up to this message ]



    Re: Apache 1.3 vhost default entries...  
Andy Davidson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-08-05 10:49 PM

[jtelep wrote in comp.infosystems.www.servers.unix]
> I've just set up my first virtual host entries on my web server and
> they are working great but I have noticed a rather annoying problem
> that I hope someone can shed some light on.  I see that my web server
> will respond to any host for my domain (existing or not) and I know
> that your first vhost entry is your default entry (i.e. any time a host
> is requested that isn't in the virtual host list this is the location
> that the page is served from).

[...snip 'how do I stop this' request]

When I want something similar to happen (I want fotoserve.net and .co.uk
to both point to the main site, but always want the uri to have the
fotoserve.*com* domain in it for cookie purposes), I create a different
'first' virual host, which defines the behaviour of what to do when
none of the other virtual hosts pick up the requests.

So the first <VirtualHost> entry is a catch-all which bounces people to
another site on the box (using a 301, although you could setup a few
pages to produce a 'no such site here' message or similar.)

Hope this helps.


--
http://fotoserve.com/ - Prints, Slides, Posters, Mugs, T-shirts,,
Calendars, Jigsaws, Tableware, Caricatures, Greetings cards, Picture
bags, Photo Album and Book covers, Canvas Prints, tissues and more
.... from your own digital images.





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:28 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register