Re: mixing dynamic and static virtual host definitions

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

 



----- "Matt Price" <matt.price@xxxxxxxxxxx> wrote:

> Hello,
> 
> I'm running apache 2.2.16 on a recent Ubuntu Maverick install (ubuntu
> 
> package version 2.2.16-1ubuntu3).  This is on a standalone box with
> just 
> a few small websites on it.  These sites mostly run wordpress 
> installations, which I manage with the dynamic stanzas suggested by
> the 
> debian package maintainers.  These look like this:
> -------------------
> <Directory />
>              Options FollowSymLinks
>              AllowOverride All
> </Directory>

That is so very wrong, I can't even begin to describe how wrong :-/
You are allowing .htaccess files from / - which means your
performance will be degraded by a good 50%
But you're also allowing *everything* in your .htaccess files,
which poses a security risk.

> <VirtualHost *:80>
>          UseCanonicalName    Off
>          VirtualDocumentRoot /var/www/%0
>          Options All
>          RewriteEngine On
>          RewriteRule ^/wp-uploads/(.*)$ /var/www/wp-uploads/%{HTTP_HOST}/$1
> </VirtualHost>
> 
> ------------------------------
> 
> These work completely unproblematically. I recently added another
> site, 
> though, which is managed by drupal.  I would like to access this site
> in 
> the following manner:
> 
> <VirtualHost *:80>
>               VirtualDocumentRoot /home/drupal-commons/drupal_commons
>               ServerName tdhc.digitalcommons.ca
> </VirtualHost>

I don't understand why you're using VirtualDocumentRoot here,
even though it's not a dynamic vhost.


> My expectation is that adding this stanza above the <VirtualHost> 
> directive I show above should direct all traffic on 
> tdhc.digitalcommons.ca to /home/drupal-commons/drupal_commons/, and 
> allow other traffic to proceed to the wordpress sites in /var/www/*. 
> 
> However, I get the following behaviour:
> 
> 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).
> 
> Can someone tell me what I'm doing wrong and how I should fix it?

Change VirtualDocumentRoot to DocumentRoot and see what happens.
Check what apache2ctl says, and if that matches your expectations.
Move the VHost declarations, and see if something changes to
apache2ctl's output. 

> Thanks so much for your help!  Best,
> Matt

So long,
i


-- 
Igor GaliÄ

Tel: +43 (0) 664 886 22 883
Mail: i.galic@xxxxxxxxxxxxxx
URL: http://brainsware.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@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