Alias-ed directory appears on multiple virtual hosts

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

 



Hello,

I've switched to a new debian server with apache 2.2.9 and installed the 'phpgadmin'
tool via a debian package.
This copies the php sources outside of /var/www and sets an 'alias ..'
directive in /etc/apache2/conf.d/

Now what happens to my surprise is that /phppgadmin is accessible via
all my virtual hosts, not just the one (base host) where it is
defined.

I also decided to serve the tool only via https, so I moved the
directive to the SSL part of my config.
Simplified, my vhost.conf (included by httpd.conf) looks like this:

NameVirtualHost 1.2.3.4:80

<VirtualHost  1.2.3.4:80>
        ServerName www.onesite.com
        ServerAlias onesite.com *.onesite.com
        DocumentRoot /var/www/
</VirtualHost>
<VirtualHost  1.2.3.4:80>
        ServerName www.twosite.com
        ServerAlias twosite.com *.twosite.com
        DocumentRoot /var/www/two/
</VirtualHost>

## SSL ##
NameVirtualHost 1.2.3.4:443
<VirtualHost 1.2.3.4:443>
        ServerName www.onesite.com
        ServerAlias onesite.com *.onesite.com
        DocumentRoot /var/www/
# pgAdmin
Alias /phppgadmin /usr/share/phppgadmin/
<Directory /usr/share/phppgadmin/>
        DirectoryIndex index.php
        Options +FollowSymLinks
</Directory>
</VirtualHost>

# end vhost.conf

So, what works as designed:
http://onesite.com
http://twosite.com
https://onesite.com/phppgadmin

What works not and should not work - i.e. throws a 404 error:
http://onesite.com/phppgadmin
http://twosite.com/phppgadmin

What works and should _not_ work:
https://twosite.com/phppgadmin

It seems that the Alias directive is applied to _all_ hosts, not just
the one inside the <VirtualHost .. /> block. From the apache docs:
http://httpd.apache.org/docs/current/mod/mod_alias.html#alias
I read the "context: Virtual host" means it is only effective in the
respective host, but maybe I misunderstood this?
Any hints how to restrict /phppgadmin on the first domain?

/ Bernd

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