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] Virtual Host warning
Date Thu, 24 Mar 2005 18:01:01 GMT
[Sorry, I accidentally sent my reply to you and not to the list.  Directing
back to the list now.]

On Thu, 24 Mar 2005 17:56:11 +0100, Jan Eden <lists@janeden.org> wrote:
> Joshua Slive wrote on 24.03.2005:
> 
> >On Thu, 24 Mar 2005 09:06:44 +0100, Jan Eden <lists@janeden.org>
> >wrote:
> >>[Thu Mar 24 09:01:08 2005] [warn] NameVirtualHost 127.0.0.1:80 has
> >>no VirtualHosts
> >>
> >>Using * for both directives removes the warning, but I'd rather use
> >>a specific IP on the production system.
> >>
> >>In case it makes a difference: The VirtualHost directives only
> >>contain different server names - the CGI script behind the scenes
> >>decides which content to deliver based on the hostname. I use Apache
> >>2.0.53.
> >
> >Hmmm... That doesn't seem like a good configuration.  I guess you are
> >saying that requests for all vhosts are being cauge by the same cgi
> >script.  In that case, you don't need a separate <VirtualHost>
> >section for each; it serves no purpose.  In general, every
> ><VirtualHost> should have  a DocumentRoot.  That might be why apache
> >is complaining.
> 
> I actually do have two complete VirtualHosts (with individual DocumentRoots), but most
of my VirtualHosts are indeed incomplete. But shouldn't Apache also complain if I have NameVirtualHost
and VirtualHost configured for all IPs/ports if the incomplete VirtualHosts are the problem?

I don't understand this paragraph.  But  another thing to look for
with regard to the error messages: You know that you should be using
only a single NameVirtualHost directive for each IP, and not one per
<VirtualHost>, right?

> 
> Regarding the setup: all content is stored in a single database and I use the various
servernames defined in my VirtualHosts directives to define RewriteCond rules like this:
> 
> RewriteCond %{HTTP_HOST} server1
> RewriteRule ^$ cgi-bin/show.pl?id=1 [L,NC]
> 
> RewriteCond %{HTTP_HOST} server2
> RewriteRule ^$ cgi-bin/show.pl?id=2634 [L,NC]
> 
> etc.
> 
> Is there another/a better way to have Apache listen to respond to all the hostnames activated
in Netinfo (I run Mac OS 10.3.5)?

<VirtualHost> sections have no effect at all on what hostnames apache
listens to.  Apache will automatically take requests for all
hostnames.  So if all the names are treated the same, you don't need a
<VirtualHost> section at all.  If you have some "normal" virtual hosts
that are not subject to the RewriteRules, then you can have a
<VirtualHost> section for each of those, and then a separate
<VirtualHost> section for all the other hosts, where you list a single
ServerName and all the other names are listed under ServerAlias.

If you are still confused about this, why don't you show us a more
complete config snippet to give us a better idea about what you are
doing.

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