All websites showing 502 Bad gateway with customized Apache port

Created:

2016-11-16 13:09:18 UTC

Modified:

2017-06-22 10:10:17 UTC

0

Was this article helpful?


Have more questions?

Submit a request

All websites showing 502 Bad gateway with customized Apache port

Applicable to:

  • Plesk for Linux

Symptoms

  1. Websites are down and show 502 Bad gateway error.

  2. Apache works on non-default port:

    # netstat -tulpn | egrep "httpd|apache"
    tcp 0 0 :::81 :::* LISTEN 19784/httpd
    tcp 0 0 :::7081 :::* LISTEN 19784/httpd

Cause

Apache misconfiguration.

Resolution

Connect to the server using SSH.

Check the Apache configuration file and find out what port is being listened:

# grep "Listen" /etc/httpd/conf/httpd.conf | grep -v ^#
Listen 81

Change Listen directive to 7080(in case if Nginx proxy is enabled) and in /etc/httpd/conf/httpd.conf and reload httpd service:

# service httpd reload

Additional information

213913245 - How to change ports of Apache running behind Nginx

Have more questions? Submit a request
Please sign in to leave a comment.