httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jsl...@gmail.com>
Subject Re: [users@httpd] Apache2: rewrite strangeness and _default_ virtual hosts
Date Sun, 22 Aug 2004 14:01:00 GMT
On Sun, 22 Aug 2004 00:42:40 -0700, Timothy Martin <tim@design1st.org> wrote:
> I've struggled with two issues since starting to use Apache2:

It's best to put different issues in different messages.  People tend
to ignore long laundry-list type emails.

For your php problem, there is no point in even looking until you have
carefully examined the output of the RewriteLog with a high
RewriteLogLevel.

> 2) The second big issue i've had with apache2 is concerning the
> _default_ virtual host. When people visit my site currently by using a
> full hostname which the DNS resolves to my server, yet apache doesn't
> have a name-based virtual host for (jvds.design1st.org for instance) it
> sends them to the first virtual host defined, just like apache docs
> specify. I didn't want this, so i thought i'd use the _default_ host as
> explained in the docs. Problem is, if i place the _default_ host
> anywhere in my configuration it ALWAYS sends ALL clients to that
> documentroot rather than to the specific hosts that the users may have
> specified.
> 
> The documentation clearly states, "A default vhost never serves a
> request that was sent to an  address/port that is used for name-based
> vhosts." But this is clearly not the case with my configuration. As
> soon as i add the _default_ it sends all traffic there regardless of
> the other virtualhosts.

Perhaps this happens when you use the * argument to the
NameVirtualHost directive rather than a specific IP.  I agree it
doesn't match the docs, but the spirit remains the same: never use
_default_ when doing name-based virtual hosting.

As it says here:
http://httpd.apache.org/docs-2.0/vhosts/name-based.html
if you want a "default" name-based vhost to match all
not-otherwise-matched names, just create another name-based
<VirtualHost> section, give it a dummy ServerName (or use the IP
address as the ServerName) and list it first in the config file.

Joshua.

---------------------------------------------------------------------
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