You are not logged in.

#1 2021-12-06 05:38:06

leanhtai01
Member
Registered: 2017-04-23
Posts: 19

Apache - Can not specify alternative user directories

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 /etc/httpd/conf/extra/httpd-userdir.conf:

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?

Offline

Board footer

Powered by FluxBB