Accessing 127.0.0.1:7080 redirects to domain in Plesk instead of default webpage (or mod_status webpage)

Created:

2016-11-16 12:57:31 UTC

Modified:

2017-04-24 12:06:17 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Accessing 127.0.0.1:7080 redirects to domain in Plesk instead of default webpage (or mod_status webpage)

Applicable to:

  • Plesk for Linux

Symptoms

When I try to access 127.0.0.1:7080 from the same machine where Plesk is installed, I am redirected to one of Plesk domains instead of default page (or Apache mod_status website).

Cause

Domains which have IPv6 binding are added additional hard-coded IPv4 binding on 127.0.0.1:7080 . This disrupts functionality of some modules like mod_status . If one of these domains is set is default for some IPv6 address, it then becomes accessible at 127.0.0.1:7080 .

This issue was submitted as internal request with ID: PPPM-1865 .

Resolution

You can apply a custom solution provided below to fix the issue on your installation:

  1. Backup all the original files:

    cd /usr/local/psa/admin/conf/templates/
    mkdir -p custom/domain/service
    cp -n /usr/local/psa/admin/conf/templates/{default,custom}/domain/domainVirtualHost.php
    cp -n /usr/local/psa/admin/conf/templates/{default,custom}/domain/service/proxy.php
    cp -n /usr/local/psa/admin/conf/templates/{default,custom}/nginxWebmailPartial.php
    cp -n /usr/local/psa/admin/conf/templates/{default,custom}/nginx.php
    cp -n /usr/local/psa/admin/conf/templates/{default,custom}/domain/nginxForwarding.php
  2. Edit the file /usr/local/psa/admin/conf/templates/custom/domain/domainVirtualHost.php . Remove the following string (make sure not to remove any other characters):

    <?php echo ($VAR->server->webserver->proxyActive && $OPT['ipAddress']->isIpV6()) ? "127.0.0.1:" . ($OPT['ssl'] ? $VAR->server->webserver->httpsPort : $VAR->server->webserver->httpPort) : ''; ?>
  3. Edit several files via stream editor :

    sed -i 's/proxyEscapedAddress/escapedAddress/g' /usr/local/psa/admin/conf/templates/custom/domain/service/proxy.php /usr/local/psa/admin/conf/templates/custom/nginxWebmailPartial.php /usr/local/psa/admin/conf/templates/custom/nginx.php
  4. Edit fle /usr/local/psa/admin/conf/templates/custom/domain/nginxForwarding.php .Replace string

    proxy_pass http://127.0.0.1:<?php echo $OPT['backendPort'] ?>;

with

    proxy_pass http://<?php echo $OPT['ipAddress']->escapedAddress ?>:<?php echo $OPT['backendPort'] ?>;
  1. Reconfigure all websites to apply new settings (this may take time):
    /usr/local/psa/admin/bin/httpdmng --reconfigure-all

After that, all bindings will receive proper values and 127.0.0.1:7080 will display default web page unless occupied by other module ( mod_status ) or web server.

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