nerdexam
CompTIA

XK0-005 · Question #10660

A Linux administrator encounters the following error in the Apache log files: SQLSTATE[HY000] [2002] Permission denied Which of the following commands should the administrator run to safely fix this…

The correct answer is B. setsebool -F httpd_can_network_connect_db on. The error indicates that SELinux is preventing Apache from connecting to the database. The command setsebool -F httpd_can_network_connect_db on allows the Apache web server to make network connections to the database, resolving the permission denied error without disabling…

Security

Question

A Linux administrator encounters the following error in the Apache log files: SQLSTATE[HY000] [2002] Permission denied Which of the following commands should the administrator run to safely fix this issue?

Options

  • Achcon -c httpd_sys_content_t /home/apache
  • Bsetsebool -F httpd_can_network_connect_db on
  • Csetenforce 0
  • Dtouch /.autorelabel

How the community answered

(68 responses)
  • A
    9% (6)
  • B
    82% (56)
  • C
    6% (4)
  • D
    3% (2)

Explanation

The error indicates that SELinux is preventing Apache from connecting to the database. The command setsebool -F httpd_can_network_connect_db on allows the Apache web server to make network connections to the database, resolving the permission denied error without disabling SELinux entirely.

Topics

#SELinux#Apache#Database Connectivity#Permission Management

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice