LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   chcon: can't apply partial context to unlabeled file... (https://www.linuxquestions.org/questions/linux-general-1/chcon-cant-apply-partial-context-to-unlabeled-file-371977/)

DevNRG 10-11-2005 02:33 PM

chcon: can't apply partial context to unlabeled file...
 
Im on FC3 and I got this message when trying to fix context for /htdocs/ and Im stumped. So thanks for any help in advance.

macemoneta 10-11-2005 03:16 PM

Umm, what command did you issue? I suspect you only supplied a partial context. Duh. :)

DevNRG 10-11-2005 04:43 PM

chcon -R -h -t httpd_sys_content_t /usr/local/apache2/htdocs

macemoneta 10-11-2005 05:19 PM

Yup, that's a partial context. You want:

chcon -h system_u:object_r:httpd_sys_content_t /usr/local/apache2/htdocs

chcon -R -h root:object_r:httpd_sys_content_t /usr/local/apache2/htdocs/*

You were setting only the type (not the user or role) of the files, which is OK if the already have those fields assigned. With them not assigned, you must fully specify the context.

DevNRG 10-11-2005 11:02 PM

Didn't get any negative error messages but it didnt fix my problem I was hoping to solve. I can't list any directories outside of /htdocs ; ie /htdocs/utstats/ . I still get access forbidden. I even did a touch test and echo thisisatest >> test. That all works fine. So Im still in a hole. Thanks for putting forth the effort though.

macemoneta 10-11-2005 11:15 PM

Check /var/log/messages for AVC access denied messages when you try to access the files. If there are none, then the issue is the http.conf. You should see something in /var/log/httpd/error_log.

DevNRG 10-12-2005 12:17 AM

[Wed Oct 12 00:15:14 2005] [error] [client 71.242.11.243] Directory index forbidden by rule: /usr/local/apache2/htdocs/utstat$


Got to check the conf.Hmm

DevNRG 10-12-2005 05:01 PM

Its fixed, thanks for the help.


All times are GMT -5. The time now is 11:51 AM.