km6zla
km6zla

Reputation: 4877

755 folder in document root not readable by apache

Story: I deleted a directory LogViewer from the document root that was browseable and working perfectly. Later I decided to add it back but now apache wont show it.

drwxr-xr-x. 12 user group 4096 Jun 19 15:16 272
drwxr-xr-x. 12 user group 4096 Jun 19 15:17 273
drwxr-xr-x.  3 user group 4096 Jun 20 08:06 LogViewer

The 272 and 273 directories are browsable and work.

enter image description here

Output of ls -lZ:

drwxr-xr-x. user group system_u:object_r:httpd_sys_content_t:s0 272
drwxr-xr-x. user group system_u:object_r:httpd_sys_content_t:s0 273
drwxr-xr-x. user group unconfined_u:object_r:user_home_t:s0 LogViewer

What I've Tried: I have restarted apache multiple times. I've stopped it, and started it. I've refreshed the browser, I've cleared cookies and all temp files.

My Question: Wtf?

Upvotes: 2

Views: 1429

Answers (1)

anubhava
anubhava

Reputation: 785128

As per: SELinux doc

To make a folder viewable from a special user public HTML folder, it needs to have a type that httpd has permissions to read, presuming the Apache HTTP Server is configured for UserDir and the Boolean value httpd_enable_homedirs is enabled.

Try this command:

chcon -R -t httpd_user_content_t LogViewer

Upvotes: 3

Related Questions