Page 1 of 1

Possible to change panel URL only ?

Posted: Mon 9. May 2022, 21:57
by amarc
Hello,

I know I can change hostname but that also changes for example Postfix's hostname which I would rather keep at something else..

I usually do panels like admin.domain.com but prefer to have MX's as mx?.domain.com

Is something like this possible ?

Re: Possible to change panel URL only ?

Posted: Tue 10. May 2022, 08:40
by Alexander
Hello,

you can rename the server with the "Hostname" feature. After that, create a new domain (preferably unter a separate user) and assign a lets encrypt certificate. Additionally you can create a redirect from this domain to the new login URL of your KeyHelp Panel.

Now you can use the new and the old name, like nothing has changes.

Re: Possible to change panel URL only ?

Posted: Tue 10. May 2022, 13:21
by amarc
So basically I change domain to one I want under MX records/Postfix under Hostname option than I create user, create admin.domain.com under that user and than chose Forwarding with destination address I previously set under Hostname ?

Re: Possible to change panel URL only ?

Posted: Tue 10. May 2022, 14:41
by Alexander
Yes.

You can always access KeyHelp with the IP, if something goes wrong, so you are able to revert the changes in that case.
Please note the sentence about HSTS below the "Hostname" input field: You may probably need to delete your browser cache.

Re: Possible to change panel URL only ?

Posted: Tue 10. May 2022, 17:16
by amarc
Thanks.. but that is only "uggly" hack to redirect 1st time visit to another URL. I guess there is no way to preserve URL in bar.

Something to maybe implement in future releases :)

A.

Re: Possible to change panel URL only ?

Posted: Tue 10. May 2022, 18:06
by Tobi
You could use Apache proxy.
Then the URL stays as it is.

You´ll find several topics about Apache proxy on this board

Re: Possible to change panel URL only ?

Posted: Tue 10. May 2022, 20:41
by amarc
Yeah.. I am getting Status 500 with something like this under Domain>Apache Settings> Directives for HTTPS:


ProxyPass / https://mx2.domain.com
ProxyPassReverse / https://mx2.domain.com/


mx2.domain.com is actual panel url (Hostname)

Re: Possible to change panel URL only ?

Posted: Tue 10. May 2022, 20:52
by Jolinar
amarc wrote: Tue 10. May 2022, 20:41 I am getting Status 500
Check, if the Apache modul proxy_http is enabled

Code: Select all

a2enmod proxy_http

Re: Possible to change panel URL only ?

Posted: Wed 11. May 2022, 09:34
by Alexander
amarc wrote: Tue 10. May 2022, 17:16 Thanks.. but that is only "uggly" hack to redirect 1st time visit to another URL. I guess there is no way to preserve URL in bar.
According to your thread title
Possible to change panel URL only ?
and your initial text
I know I can change hostname but that also changes for example Postfix's hostname which I would rather keep at something else..
My solution is perfectly valid and i would not consider it hacky at all. If this is not the solution you looked for, you may need to specify what solution you are looking for.

The "redirect" was just a bonus and I have only mentioned it for convenience for your customers.
-> You wanted an other panel URL (i assume for log in) that's what you've got when changing the Hostname.
-> You wanted to keep the MX and etc. that's what you achieve when creating a new domain with the old name.

Re: Possible to change panel URL only ?

Posted: Wed 11. May 2022, 11:18
by amarc
I am looking for:

- Set Hostname to mx.domain.com
- Set panel (HTTP/HTTPS) URL to admin.domain.com
- Make admin.domain.com permanenent not only one time redirection to mx.domain.com

Creating admin.domain.com domain and redirecting it to https://mx.domain.com makes no sense to me as any action/click after that would be on https://mx.domain.com and in that case I could just give users panel URL in form of https://mx.domain.com

Would make sense (IMO) to make something in settings like:

- Change Panel URL (which would change only that and change this under Apache only in /etc/apache2/keyhelp/keyhelp.conf)
- Change Hostname > change /etc/hostname and anything related to that ie. Postfix/Dovecot/etc (which currently this setting is doing)

Again, not sure how this affects backend but seems sane to me from here. :)

A.

Re: Possible to change panel URL only ?

Posted: Thu 12. May 2022, 13:26
by amarc
Simple solution for this is to:

- Edit /etc/apache2/keyhelp/keyhelp.conf

- Add ServerAlias like so

Code: Select all

# KeyHelp / Tools
<VirtualHost *:443>
    ServerName mx2.domain.com
    ServerAlias admin.domain.com
    ServerAdmin root@mx2.domain.com
Now probably this will be overwritten on update(s) ? But something I can live with and adjust from time to time..