exam questions

Exam XK0-004 All Questions

View all questions & answers for the XK0-004 exam

Exam XK0-004 topic 1 question 271 discussion

Actual exam question from CompTIA's XK0-004
Question #: 271
Topic #: 1
[All XK0-004 Questions]

While trying to access a website hosted on the server, the systems administrator receives the following error message:

The administrator then performs some diagnostics:

Which of the following commands should the administrator use to fix the issue?

  • A. chown -R www:www /var/www/website
  • B. chcon -t httpd_sys_content_t /etc/httpd
  • C. chmod -R 777 /var/www/website
  • D. restorecon /var/www/html/website/index.html
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
RichardJRL
Highly Voted 3 years ago
Selected Answer: D
Ok, am I alone in thinking it could be D due to the SELinux security context difference between /var/www/html (which has the context httpd_t) and /var/www/html/website (which has the context default_t)? Yes the ls -l output shows a root:root for ownership but the dir has r-x permissions for everyone and the file has read permissions for everyone... so the webserver should be able to access the files it needs to serve even if the ownership of the /var/www tree probably should be changed to the www user & group. Something else is stopping access to the file and that's probably SELinux
upvoted 6 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago