What is the proper way to use an alternate public_html path?

Matej Cepl mcepl at redhat.com
Mon Dec 15 09:40:58 UTC 2008


On 2008-12-14, 16:09 GMT, Paul Howarth wrote:
>> i would like to use ~/Public insted of ~/public_html.
>> 
>> What is the proper way to do this such that restorecon respects the
>> change?
>
> I do it by creating a local policy module (localmisc) and put this (I
> use ~/WWW for this purpose) in localmisc.fc:
>
> HOME_DIR/WWW(/.*)? gen_context(system_u:object_r:public_content_rw_t,s0)

I think you could be all right just with semanage

semanage fcontext -a \
    -t httpd_user_content_t \
    '/home/.*/Public(/.*)?'

should be enough. Of course, you have to fiddle with the regexp 
to suit your configuration.

Matěj




More information about the fedora-selinux-list mailing list