mediumMultiple ChoiceObjective-mapped
XK0-006 Practice Question: A Linux server running RHEL 9 has SELinux in…
A Linux server running RHEL 9 has SELinux in enforcing mode. A web application (Apache) is serving content from a custom directory /var/www/html/myapp. The application needs to write to a subdirectory /var/www/html/myapp/uploads. The administrator sets the context of the uploads directory to httpd_sys_content_t and also runs `restorecon -Rv /var/www/html/myapp`. However, Apache still cannot write to the uploads directory. The administrator checks the SELinux denials in /var/log/audit/audit.log and sees AVC denials related to writing. Which step should the administrator take next?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Change the type of the uploads directory to httpd_sys_rw_content_t.
The httpd_sys_content_t type is for read-only content. For read-write access, the directory must have type httpd_sys_rw_content_t (or httpd_sys_script_rw_t for scripts). Setting this type via `chcon -t httpd_sys_rw_content_t /var/www/html/myapp/uploads` will allow Apache to write. Option A (boolean httpd_enable_homedirs) is unrelated. Option C (add to group) does not address SELinux.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Disable SELinux temporarily.
Why it's wrong here
Not a permanent solution; it may also violate security policy.
- ✗
Set the boolean httpd_enable_homedirs to on.
Why it's wrong here
This boolean controls access to home directories, not to /var/www/html.
- ✗
Add the apache user to the group that owns uploads.
Why it's wrong here
SELinux still blocks even with correct DAC permissions.
- ✓
Change the type of the uploads directory to httpd_sys_rw_content_t.
Why this is correct
This type allows Apache to write into the directory.
Go deeper
Related to this question
About these practice questions
This XK0-006 question is part of Courseiva's 979-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.