NGINX & HTTPD (Apache) conflicting port bindings when restarting EC2

Issue #37 new
Austin Tapia created an issue

Can we get a fix for this possibly through redirection with iptables or NGINX Reverse Proxying?

NGINX and HTTPD are both configured to bind to port 80, which is a conflicting issue when stopping an instance and then starting it up again, because of this I cannot start both. I’m stuck with only starting one therefore rendering both of them useless since they work together.

THESE BOTH APPLY TO NGINX & HTTPD, HTTPD IS ONLY SHOWN BELOW BUT IS THE SAME FOR NGINX.

# netstat -ltnp | grep :80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 8603/nginx: master
tcp6 0 0 :::80 :::* LISTEN 8603/nginx: master
tcp6 0 0 :::8080 :::* LISTEN 6288/javajournalctl -xe

# journalctl -xe

-- Unit httpd.service has begun starting up.

Apr 22 22:29:59 ip-REDCTED.us-REDACTED-REDACTED.compute.internal httpd[8620]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80

Apr 22 22:29:59 ip-REDACTED.us-REDACTED-REDACTED.compute.internal httpd[8620]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

Apr 22 22:29:59 ip-REDACTED.us-REDACTED-REDACTED.compute.internal httpd[8620]: no listening sockets available, shutting down

Apr 22 22:29:59 ip-REDACTED.us-REDACTED-REDACTED.compute.internal httpd[8620]: AH00015: Unable to open logs

Apr 22 22:29:59 ip-REDACTED.us-REDACTED-REDACTED.compute.internal systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE

Apr 22 22:29:59 ip-REDACTED.us-REDACTED-REDACTED.compute.internal systemd[1]: Failed to start The Apache HTTP Server.

Comments (2)

  1. Log in to comment