Score:0

Apache - Can not specify alternative user directories

ye flag

As the docs said: It is possible to specify alternative user directories:

It is also possible to specify alternative user directories. If you use a command like:

UserDir "public_html" "/usr/web" "http://www.example.com/"

With a request for http://www.example.com/~bob/one/two.html, will try to find the page at ~bob/public_html/one/two.html first, then /usr/web/bob/one/two.html, and finally it will send a redirect to http://www.example.com/bob/one/two.html.

Here is my config (file: /etc/httpd/conf/extra/httpd-userdir.conf in Arch Linux):

UserDir "public_html" "/run/media/*/web/public_html"

<Directory "/home/*/public_html">
    AllowOverride FileInfo AuthConfig Limit Indexes
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    Require method GET POST OPTIONS
</Directory>

<Directory "/run/media/*/web/public_html">
    AllowOverride FileInfo AuthConfig Limit Indexes
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    Require method GET POST OPTIONS
</Directory>

But Apache can only find files in directory that listing first (in this case "public_html"), If I try to access file in next directories, It said Object not found.

Using only one Userdir is work fine (either "public_html" or "/run/media/*/web/public_html" but not both).

Does anyone know what I'm doing wrong?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.