- A
Set the SELinux boolean httpd_enable_homedirs to on using setsebool.
Why wrong: This boolean allows httpd to access home directories, not custom content.
- B
Run restorecon -R -v /var/www/customcontent after setting the default context with semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/customcontent(/.*)?'
Sets the type to httpd_sys_rw_content_t and applies it recursively.
- C
Change the context to httpd_sys_content_t using chcon -R -t httpd_sys_content_t /var/www/customcontent
Why wrong: This type is read-only.
- D
Run semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/customcontent(/.*)?' without running restorecon.
Why wrong: semanage only sets the policy; restorecon must be run to apply the context.
Quick Answer
The correct next step is to set the default SELinux context to httpd_sys_rw_content_t using semanage fcontext and then apply it with restorecon. The directory currently has httpd_sys_content_t, which only permits read access; to enable httpd write permission to a custom directory, the type must be changed to httpd_sys_rw_content_t, as the “rw” suffix explicitly grants read-write capabilities. On the Red Hat Certified System Administrator EX200 exam, this scenario tests your understanding of persistent SELinux context changes versus temporary chcon commands—a common trap is using chcon alone, which does not survive a filesystem relabel. The correct workflow uses semanage fcontext to define the default policy and restorecon to apply it, ensuring Apache can write without disabling SELinux. Memory tip: think “rw” for read-write, and remember that semanage sets the rule, restorecon enforces it.
EX200 Manage security Practice Question
This EX200 practice question tests your understanding of manage security. The scenario asks you to isolate a root cause — eliminate options that address a different problem before choosing. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
A junior administrator is tasked with setting up SELinux contexts on a Red Hat Enterprise Linux 9 server to allow Apache HTTPD to read and write to a custom directory /var/www/customcontent. The directory already exists and contains several files. The administrator has confirmed that the httpd service is running and SELinux is in enforcing mode. After changing the context to httpd_sys_content_t using chcon, the web server can read files but cannot write to the directory. The administrator needs to fix this without disabling SELinux or changing the mode to permissive. Which of the following is the correct next step?
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
Run restorecon -R -v /var/www/customcontent after setting the default context with semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/customcontent(/.*)?'
The directory already has the httpd_sys_content_t type, which allows reading but not writing. To enable write access, the correct type is httpd_sys_rw_content_t. Option B correctly uses semanage fcontext to set the default context to this type and then runs restorecon to apply it persistently, ensuring Apache can both read and write.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Set the SELinux boolean httpd_enable_homedirs to on using setsebool.
Why it's wrong here
This boolean allows httpd to access home directories, not custom content.
- ✓
Run restorecon -R -v /var/www/customcontent after setting the default context with semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/customcontent(/.*)?'
Why this is correct
Sets the type to httpd_sys_rw_content_t and applies it recursively.
Related concept
Read the scenario before looking for a memorised answer.
- ✗
Change the context to httpd_sys_content_t using chcon -R -t httpd_sys_content_t /var/www/customcontent
Why it's wrong here
This type is read-only.
- ✗
Run semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/customcontent(/.*)?' without running restorecon.
Why it's wrong here
semanage only sets the policy; restorecon must be run to apply the context.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates may think setting the context with chcon or semanage alone is sufficient, but they overlook the need to run restorecon to apply the new default context to existing files, or they confuse httpd_sys_content_t (read-only) with httpd_sys_rw_content_t (read-write).
Detailed technical explanation
How to think about this question
SELinux type enforcement uses specific types like httpd_sys_content_t (read-only) and httpd_sys_rw_content_t (read-write) to control Apache's access. The semanage fcontext command modifies the file context policy database, while restorecon applies those rules to the filesystem; without restorecon, the change is not effective until a relabel occurs. In real-world scenarios, using chcon for temporary fixes can be overwritten by restorecon or a full relabel, so semanage fcontext is the persistent method required for production systems.
KKey Concepts to Remember
- Read the scenario before looking for a memorised answer.
- Find the constraint that changes the correct option.
- Eliminate answers that are true in general but not in this case.
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A practitioner preparing for the EX200 exam encounters this exact type of scenario on the job. The correct answer here is not the most general option — it is the best answer for the specific constraint described. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Real exam questions reward reading the full scenario before eliminating options, because the constraint defines which answer fits.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
- →
Manage security — study guide chapter
Learn the concepts, then practise the questions
- →
Manage security practice questions
Targeted practice on this topic area only
- →
All EX200 questions
527 questions across all exam domains
- →
Red Hat Certified System Administrator EX200 study guide
Full concept coverage aligned to exam objectives
- →
EX200 practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related EX200 practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Operate running systems practice questions
Practise EX200 questions linked to Operate running systems.
Configure local storage practice questions
Practise EX200 questions linked to Configure local storage.
Create and configure file systems practice questions
Practise EX200 questions linked to Create and configure file systems.
Deploy, configure, and maintain systems practice questions
Practise EX200 questions linked to Deploy, configure, and maintain systems.
Manage users and groups practice questions
Practise EX200 questions linked to Manage users and groups.
Manage security practice questions
Practise EX200 questions linked to Manage security.
Manage containers practice questions
Practise EX200 questions linked to Manage containers.
Create simple shell scripts practice questions
Practise EX200 questions linked to Create simple shell scripts.
Essential Tools practice questions
Practise EX200 questions linked to Essential Tools.
EX200 fundamentals practice questions
Practise EX200 questions linked to EX200 fundamentals.
EX200 scenario practice questions
Practise EX200 questions linked to EX200 scenario.
EX200 troubleshooting practice questions
Practise EX200 questions linked to EX200 troubleshooting.
Practice this exam
Start a free EX200 practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this EX200 question test?
Manage security — This question tests Manage security — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: Run restorecon -R -v /var/www/customcontent after setting the default context with semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/customcontent(/.*)?' — The directory already has the httpd_sys_content_t type, which allows reading but not writing. To enable write access, the correct type is httpd_sys_rw_content_t. Option B correctly uses semanage fcontext to set the default context to this type and then runs restorecon to apply it persistently, ensuring Apache can both read and write.
What should I do if I get this EX200 question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more ways this is tested on EX200
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. Refer to the exhibit. A web server (httpd) is unable to serve files from a user's home directory. What is the most appropriate single command to resolve the issue?
hard- A.chcon -u system_u /home/user/www/index.html
- B.setsebool -P httpd_enable_homedirs on
- ✓ C.semanage fcontext -a -t httpd_sys_content_t '/home/user/www(/.*)?' && restorecon -Rv /home/user/www
- D.chcon -r object_r /home/user/www/index.html
Why C: Option C is correct because it uses `semanage fcontext` to set the default SELinux file context for the `/home/user/www` directory tree to `httpd_sys_content_t`, then applies it with `restorecon`. This is the proper way to persistently label custom web content directories so that httpd can serve them, as SELinux policy by default blocks httpd from reading user home directories.
Last reviewed: Jun 11, 2026
This EX200 practice question is part of Courseiva's free Red Hat 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 EX200 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.