httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeffrey T. Sims" <jtsi...@comcast.net>
Subject RE: [users@httpd] Multiple Domains on one web server - no external access
Date Mon, 09 Feb 2004 04:27:50 GMT
Brian -

This worked perfectly.  I didn't realize that I was mixing Named-based
versus IP-based vhosting formats.  Thanks for your assistance.

-----Original Message-----
From: Brian Dessent [mailto:brian@dessent.net]
Sent: Friday, February 06, 2004 3:29 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Multiple Domains on one web server - no
external access


"Jeffrey T. Sims" wrote:

> I'm hosting multiple registered domains on one OpenBSD 3.4 server running
> Apache 1.3.28.  I also run DNS on this machine.  The box has one NIC with
a
> static IP (10.2.1.8) and aliases for each additional domain (10.2.1.#).
On
> the internal network, all domains properly resolve and show the
appropriate
> index page for that domain; however, external users can't access the
proper
> index page.  Everything rolls to the default domain (domain1.com).  All
> in-bound http traffic is directed by the router to the DNS/Web server
> (10.2.1.8).
>
> I find my results very strange after browsing the list for similar issues.
> The other postings seem to have the reverse condition - external users can
> hit each domain index page, but internal users can't.  I am perplexed!

It looks like you're trying to do both IP-based and Name-based virtual
hosting with the same setup.  In other words, external users are going
to be coming in on the same IP:port combination and differentiating the
site based on the "Host:" header.  Your internal LAN peers are going to
be differentiating the different sites by IP address however.

You should settle on one or the other -- either have each vhost on its
own IP address, or have them on the same IP address but each with a
different ServerName.  If you have only one external IP address, you
need to do name-based vhosting, unless you want each server on a
different port (and there's really no reason why you should want that.)

I suggest that you just go with pure name-based virtual hosting.  Give
your web server a single IP address of 10.2.1.8.  In your firewall,
forward all port 80 traffic to that machine  In your local DNS server,
configure all your hosted domain names to resolve to the 10.2.1.8
address.  In the real DNS that the domains point to, have all those
domain names point to the same external IP address.  Then have something
such as:

NameVirtualHost 10.2.1.8:80
<VirtualHost 10.2.1.8>
  ServerName www.domain1.com
  # anything that applies to domain1 here
</VirtualHost>

<VirtualHost 10.2.1.8>
  ServerName www.domain2.com
  # anything that applies to domain2 here
</VirtualHost>

<VirtualHost 10.2.1.8>
  ServerName www.domain3.com
  # anything that applies to domain3 here
</VirtualHost>

In other words, if your servers are differentiated by IP address, then
it's not going to work right when all the external requests come in on
the same IP address.  For that you'd need to do name-based vhosting
across the board.

Brian

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message