[CentOS] Help with httpd userdir recovery

Robert Moskowitz rgm at htt-consult.com
Tue Dec 27 22:02:19 UTC 2016



On 12/27/2016 02:58 PM, Leonard den Ottolander wrote:
> Hello Robert,
>
> On Tue, 2016-12-27 at 12:43 -0500, Robert Moskowitz wrote:
>> My understanding (most likely flawed) is that Indexes are needed to see
>> the list of files in mydir,
> Correct.
>
>>   and to be able to walk down to subdir.
> Incorrect. The index is a convenience. Without it directories with the
> right permissions are still accessible with a direct url. So there's not
> much point enabling indexes when you use an index file to avoid the
> index showing up...
>
>> restorecon -Rv /home
> The man page for restorecon explicitly states it does not follow
> symlinks, and it might not cross file system boundaries either, so make
> sure they are not causing your issue.

No symlinks.

>> the owner is rgm:rgm, but the permissions is 755, not 711.
> You have to make sure apache can access the whole path, meaning you need
> at least o+x on all directories in the path. This is quite likely *not*
> the case for /home/rgm.

So I deleted the whole public_html directory.  Re moved the files over.  
I went back to the default user_dir setup of:

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

Restarted httpd and tried again.  I get my ~/public_html/index.html to 
display, cannot get a directory list to display.  I can display a file.  
If I list a specific jpg in one of the directories it comes up ok, but I 
am not getting the listing option.

access_log:

192.168.160.12 - - [27/Dec/2016:16:53:00 -0500] "GET 
/~rgm/cubieboard/cubietower-2.JPG HTTP/1.1" 200 1450256 "-" "Mozilla/5.0 
(X11; Fedora; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0"
192.168.160.12 - - [27/Dec/2016:16:53:08 -0500] "GET /~rgm/cubieboard/ 
HTTP/1.1" 403 218 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:50.0) 
Gecko/20100101 Firefox/50.0"

error_log:

[Tue Dec 27 16:53:08.858042 2016] [negotiation:error] [pid 1965] 
(13)Permission denied: [client 192.168.160.12:55644] AH00686: cannot 
read directory for multi: /home/rgm/public_html/cubieboard/


So I have the permissions right to retrieve files.  Something is wrong 
for displaying the directory list.

:(





More information about the CentOS mailing list