Apache WebDAV Configuration - Map Directory As Subdirectory

1

In Apache, how do I map a directory as a subdirectory in another directory?

e.g. I have two directories:

/var/www/aaa
/var/www/bbb

Directory /bbb should be also available in /aaa/bbb.

I tried:

Alias "/aaa/bbb" "/var/www/bbb"
<Directory "/var/www/bbb">
Dav on
Options Indexes
</Directory

<Directory "/var/www/aaa">
Dav on
Options Indexes
</Directory

This works in so far as I can access /aaa/bbb directly. But if I open /aaa, the "virtual" subdirectory /aaa/bbb will not be shown.

How can I fix this?

John Hawk

Posted 2019-06-04T13:07:02.220

Reputation: 13

Answers

0

I tried Alias "/aaa/bbb" "/var/www/bbb"[...] This works in so far as I can access /aaa/bbb directly. But if I open /aaa, the "virtual" subdirectory /aaa/bbb will not be shown.

The Alias command simply maps a given URL (/aaa/bbb) to a file system path (/var/www/bbb). Any URL (e.g. literally /nonsense/url) could be mapped to /var/www/bbb in Apache with Alias. The URL has no relation to the directory structure on your drive (which is what you are seeing when you access /aaa directly).

The simple solution to your issue is to create a symbolic link (or similar) in /aaa to /bbb. It's worth noting that this is done in your OS, not Apache. Assuming Apache is configured correctly, /bbb should be displayed as a normal directory link when accessing /aaa.

Anaksunaman

Posted 2019-06-04T13:07:02.220

Reputation: 9 278

Thanks. I hoped there is an apache-only solution. I tried symbolic links but unfortunately not all WebDAV Clients we use support them :-/ – John Hawk – 2019-06-05T04:38:19.117