selinux and per-user web directories

anonymous bitskrieg at gmail.com
Mon Apr 20 21:22:18 UTC 2009


Hi,

I wanted to create my own web directory to serve pages from for obvious
reasons.
I edited the httpd.conf file appropriately using the UserDir defaults.
I then changed the permissions on my home folder (chmod 711) and then on my
web directory as root (chmod 755).
On most distros this is more than enough, on Fedora I had to deal with
SELinux.

I used the system-config-selinux command as root to enable all the apache
restrictions and some others as well.
Thanks due to this website:
http://optics.csufresno.edu/~kriehn/fedora/fedora_files/f9/howto/selinux.html<http://optics.csufresno.edu/%7Ekriehn/fedora/fedora_files/f9/howto/selinux.html>

SELinux still prevented the apache from serving from the directory.
I then used the command:
# chcon -R -h -t httpd_sys_content_t  my_web_dir

And finally, I could serve pages alongside SELinux.

However, I've run into a strange problem.

http://localhost/~user/ OKAY
http://localhost/~user/newdirX OKAY
http://localhost/~user/newdirX/newdirY NOT OKAY

The newdirY is hidden.
Is there some directory depth restriction used by apache?
I don't think this is an SELinux problem because no warning is issued, I
might be wrong.

I'd like to be able to create limitless directories in my webdir and have
their contents served without issue.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20090420/d2bad80a/attachment-0001.htm>


More information about the fedora-list mailing list