• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved mydomain:8443 redirects to https://ip-xx-xx-xx:8443

ManuelGDot

Basic Pleskian
Hi,

I've got a webserver set up and running (Ubuntu 16.04 / Plesk 12.5).

When I try to connect to Plesk like by typing into the browser mydomain.com:8443 I'm redirected to this: https://ip-xx-xx-xx-xx:8443 (internal IP of my server). That of course doesn't work.

When I type in https://mydomain.com:8443 there's no problem, I can log into Plesk.

Where is the place to configure this behaviour so I'm redirected to https://mydomain:8443 instead?

Thanks.
 
Is the field Tools & Settings > General Settings > Server Settings > Hostname populated?
 
O.k., in Tools & Settings > IP Addresses: When you click on the IPv4 address in question, is the "default site" defined?
 
Does /etc/sw-cp-server/config contain a line "error_page 497"? What content has that line? Has /etc/sw-cp-server/config ever been modified by you? Have any IP addresses recently changed on the server or have their use changed, e.g. from dedicated to shared?
 
The content of that line is
error_page 497 https://$hostname:$server_port$request_uri;

No, I never modified any config files on this server, cause it's a pretty fresh install. I've toggled IP settings inside Plesk between dedicated and shared to see if it got anything to do with the issue.

One thing that has changed since install though, the VM had been moved and also assigned a new external IP.
 
Thanks to Peter's hint I also checked the hostname via uname -n on the shell.

The hostname is indeed this "ip-xx-xx-xx" that shows up in the url. I'm still not sure where to head. Renaming the host and giving it the domain name seems weird, not sure this is the solution.
 
In that case you can try to check these files:
/etc/hosts
/etc/hostname
(one might not be there). Enter your host's domain name as the first domain name after the public IPv4 and IPv6 addresses given in /etc/hosts, for example similar to this:

Code:
# nameserver config
# IPv4
127.0.0.1       <my-long-domain-name.tld> <my-short-domain> localhost.localdomain localhost
123.222.111.222 <my-long-domain-name.tld> <my-short-domain>
#
# IPv6
::1     <my-long-domain-name.tld> <my-short-domain> ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
3abc:4abf:211:2abc::2 <my-long-domain-name.tld> <my-short-domain>

The <my-short-domain> can be omitted. For <my-long-domain-name.tld> enter your domain name.

Edit: I forgot to mention that is is possible that you need to reboot afterwards for the changes to take affect. You can try first without reboot, but if it does not react properly it might need one.
 
I tried to change the hostname like Peter suggested, but sadly this doesn't work.
On Ubuntu 16.04 it seems the hostname needs to be changed using
hostnamectl set-hostname


Also I'm still not sure this is the desired solution.
I've read up on the issue a bit more, it seems recently there was a bug regarding a similar issue, but it's now fixed. So in conclusion mydomain.com:8443 simply is non-existent and redirects to the preset error page of Plesk. I just don't understand why you would use the hostname as errorpage URL? It doesn't make sense to me. Maybe someone can explain.
 
Sadly I am not the Ubuntu guy, but from the Red Hat / CentOS world. For all your Ubuntu needs: @UFHH01 :D He'll probably show up in the thread soon to sort this out for Ubuntu.

The errorpage line forwards from the non-SSL to SSL connection. I was asking about this line, because it can also be "abused" as a tweak to forward a request of one domain to another, so there was a chance that maybe it contained an individual forward directive. But it is o.k. as it is, you can leave it as it is.
 
Anyway huge thanks to you, Peter for your help! Really appreciate it. :)

At least I now have clarity what's going on. Maybe I'll make a feature request so this can be configured individually within Plesk.

I've just checked my other Servers with Plesk at different hosters, this problem exists everywhere. :D I never noticed cause I got the https URLs bookmarked.

I'd say there's no better solution atm than to change the hostname - lets close this topic then.
 
Hi ManuelGDot,

On Ubuntu 16.04 it seems the hostname needs to be changed using
hostnamectl set-hostname
öhm... nope... pls. just follow the suggestions from @Peter Debik, as they are absolute correct for CentOS/RHEL AND Debian/Ubuntu, if you desire to change your hostname.
On Debian/Ubuntu - based systems, BOTH files are existent and should be edited ( "/etc/hostname" AND "/etc/hosts" ) as suggested by Peter.

Thanks to Peter's hint I also checked the hostname via uname -n on the shell.
Just use the simple word "hostname" on your command line, followed by "enter/return", if you desire to get the defined hostname on your server.

Maybe I'll make a feature request so this can be configured individually within Plesk.
Well, you don't have to do that, as setting up the hostname via "HOME > Tools & Settings > Server Settings" is already existent over your Plesk Control Panel and you might consider to use it, if you desire to change it. Test it out ( maybe with a different setting ) and check the mentioned files afterwards, to see the results. ;)

But Plesk will not "reboot" the server for you, so pls. keep in mind, that YOU have to do that on your own, if you want the setting being permanent. :)
 
@UFHH01 Following the instruction from Peter results in the error documented here:
Can't change hostname or FQDN on Ubuntu 14.04 LEMP droplet | DigitalOcean

There in the comments section also the new solution was suggested. Yes, I knew already that the command hostname exists. I just don't want to rename my system, cause I think it makes no sense here.

I should have mentioned that indeed the hostname set in Plesk > Tools & Settings > Server Settings already is present in /etc/hosts, but not exactly like Peter noted, still that didn't solve the problem as I mentioned before.

PHP hostname, in it's various fashions, outputs the "Computer name" like on all my Plesk installations, exactly like uname -n. I'm assuming Plesk uses that in one or the other way, haven't checked further.
PHP: gethostname - Manual

What I haven't tested yet if setting the host name in Plesk + reboot afterwards affects the issue, cause I don't want to reboot right now. I can follow up with this later.
 
Ok, just tested it, setting up the hostname in Plesk > Tools & Settings > Server Settings and rebooting afterwards does not solve the issue.

The error page still is https://ip-xx-xx-xx/... (that is my hostname, meaning the "computer name", not the hostname set in Plesk)
 
Hi ManuelGDot,

I just don't want to rename my system, cause I think it makes no sense here.
Feel free to do what ever you would like to... it's your server and YOUR settings. We are only able to suggest ways to solve possible issues with Plesk and it's components. :)

Pls. note as well, that the reverse of the IP and it's depending FQDN entry has to be done over the Control Panel from your server provider ( if they offer such an option ).


If you need further help, pls. consider to provide the IP and your FQDN for further investigations.
 
Back
Top