Re: mixing dynamic and static virtual host definitions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 On 10-10-23 09:33 AM, Eric Covener wrote:
1) if the new stanza is placed above the old one, then ALL traffic arriving
at this server is directed to  /home/drupal-commons/drupal_commons.
2) if the new stanza goes below the old, it is ignored entirely (this is
what I expected).
You need 1  "NameVirtualHost *:80" to tell Apache to do name-based
vhosts on those vhosts.   Then keep the generic one listed first, so
it will be the default for *:80.

(You might have "NameVirtualHost *" in your debian conf, but it needs
to be a literal match.)

I have one NameVirtualHost *:80 which is in /etc/apache2/conf.d/ports.conf -- this is read before my site-specific conf stuff, I'm pretty sure.

I guess I don't quite understand what you're recommending. Won't the generic stanza, which has dynamic matching:


<VirtualHost *:80>
        UseCanonicalName    Off
        VirtualDocumentRoot /var/www/%0
        Options All
        RewriteEngine On
        RewriteRule ^/wp-uploads/(.*)$ /var/www/wp-uploads/%{HTTP_HOST}/$1
</VirtualHost>

pr-empt any later stanza? I thought that was the expected behaviour, and it explained to me why I have trouble when I put it first. But if the site-specific stanza for the new drupal stie goes first,

<VirtualHost *:80>
            DocumentRoot /home/drupal-commons/drupal_commons
            ServerName drupalsite.example.com
</VirtualHost>

then it pre-empts everything (not what I expected, since I'm using ServerName, which I thought limited the application of this stanza to instances in which HTTP_HOST matches. ServerName. Is the problem perhaps with the globbing in the directive declaration? If so I don't see how to fix it, since I can't differentiate by IP (only one IP on this machine).

Thanks again for all your help.  Best,
Matt


---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux