nerdexam
CompTIA

XK0-004 · Question #516

A Linux administrator is installing an NGINX-based proxy service on the same server that hosts the Apache-based HTTP services When the administrator launches the proxy service, the following error…

The correct answer is B. An application is using port 80. The error 'Address already in use' on port 80 indicates that another process, in this case Apache/httpd, has already bound to that port before NGINX attempts to start.

Troubleshooting and Diagnostics

Question

A Linux administrator is installing an NGINX-based proxy service on the same server that hosts the Apache-based HTTP services When the administrator launches the proxy service, the following error message is received:

Address already in use: make_sock: could not bind to address 0.0.0.0:80 The administrator runs the following commands to troubleshoot the issue and receives the following relevant output:

Which of the following is the MOST likely issue?

Exhibit

XK0-004 question #516 exhibit

Options

  • AA FORWARD chain rule in iptables is missing
  • BAn application is using port 80
  • CApache is only listening on localhost:80
  • DThe httpd is missing the proxy module

How the community answered

(28 responses)
  • A
    4% (1)
  • B
    82% (23)
  • C
    11% (3)
  • D
    4% (1)

Why each option

The error 'Address already in use' on port 80 indicates that another process, in this case Apache/httpd, has already bound to that port before NGINX attempts to start.

AA FORWARD chain rule in iptables is missing

A missing FORWARD chain rule in iptables governs packet routing between interfaces and has no effect on whether a local process can bind to a socket address.

BAn application is using port 80Correct

The error message 'make_sock: could not bind to address 0.0.0.0:80' is the operating system's explicit signal that a socket on port 80 is already claimed by a running process. Since Apache is already running on the same server and defaults to port 80, NGINX cannot also bind to that same address and port. Resolving this requires either stopping Apache, moving one service to a different port, or configuring a shared socket approach.

CApache is only listening on localhost:80

If Apache were only listening on localhost:80, it would still hold that port on the loopback interface, and the actual error references 0.0.0.0:80, meaning NGINX is trying to bind all interfaces - the root cause is still port 80 being occupied.

DThe httpd is missing the proxy module

A missing proxy module in httpd would produce a configuration or module-loading error, not a socket binding failure, so it cannot cause this specific error message.

Concept tested: Port conflict diagnosis on Linux services

Source: https://nginx.org/en/docs/beginners_guide.html

Topics

#port conflict#NGINX#Apache#socket binding

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice