CompTIA Linux+ (XK0-005) — Question 165

A Linux administrator is installing a web server and needs to check whether web traffic has already been allowed through the firewall. Which of the following commands should the administrator use to accomplish this task?

Answer options

Correct answer: C

Explanation

The correct command is 'firewall-cmd --query-service http', as it directly queries the firewall to see if the HTTP service is allowed. Option A is incorrect because it does not use the proper syntax. Option B checks the service but does not perform a query. Option D is invalid syntax for checking the service status.