Name of a host with Hestia Control Panel

Hello everybody,

I have a couple of Hostia Control Panel instances on two hosts, ouvm2 and ouvm3. Let’s say they are available at:

https://hcp.ouvm2.abc.de:8083
https://hcp.ouvm3.abc.de:8083

I noticed that right after installing HestiaCP, the host names returned by the hostname command changed to:

hcp.ouvm2.abc.de
hcp.ouvm3.abc.de

Recently I noticed that this same hcp short host name appears in various logs generated by both of these hosts, which is not the best, since now it’s harder to differentiate between them.

Is it possible to customize the short name of a host with HestiaCP without changing the URL where the HestiaCP is accessible? If yes, how?

Thank you.

Yes you can!
You need to create a cp template on nginx php-fpm templates. Follow the steps:

  1. You need to go at: cd /usr/local/hestia/data/templates/web/nginx/php-fpm/
  2. Add those files in there:
    wget https://gist.sahsanu.net/sahsanu/e6bb6e7f70d5447b9c3fabdeb9a738be/raw/HEAD/cp.tpl
    wget https://gist.sahsanu.net/sahsanu/4e74e34efd47426e921e6a49d7f20e1c/raw/HEAD/cp.stpl
  3. Edit the domains you want and on nginx templates choose the cp
  4. Done! Maybe you will see some errors like on creating or deleting something the loading circle never ends but if you refresh the action will be completed.

PS: Thanks to @sahsanu for giving this cp template!

Thank you.

Focusing on only one of the hosts, let’s say ouvm2, the domain you mentioned at point 3 would then be hcp.ouvm2.abc.de, namely the one which is available only to the admin user?

No it will be available for everyone. It will be like using this https://hcp.ouvm2.abc.de:8083 just without the port. With little words your domain or your subdomain hcp.ouvm2.abc.de will be the hestia control panel, everyone who visit this will see the login page of HestiaCP and if they are users they can connect.

I am not sure I understand your answer.

Initially you provided two templates. To which domain should I attach them?

You can select any domains you want…

I am not sure I understand your answer, either. I’ll try to provide some more details.

My initial question was if I could use the HestiaCP without it changing the short host names of my hosts to hcp, which is the prefix of the HestiaCP domains.

By short host name I meant the internal host name returned by the hostname terminal command, which is the same as the content of the /etc/hostname configuration file, and which gets used as a system variable all over the place, such as, for instance, in the syslog.

As it is the content of this file on ouvm2 is hcp.ouvm2.abc.de

But before installing HestiaCP it was just ouvm2 and the HestiaCP installer changed it to hcp.ouvm2.abc.de, which is unfortunate. I wish to have this original ouvm2 hostname. Now I did change the content of /etc/hostname back to ouvm2 at some point and, if I remember correctly, following that, one or more of the HestiaCP mail services stopped working. So I changed the internal host name back to hcp.ouvm2.abc.de.

I understood that it is possible to come back to the original internal host name and got instructions on using a pair of template files. From what I know, any such pair must be attached to a domain name.

The HestiaCP on ouvm2 manages the following domains:

So to which domain or domains should I apply the templates your recommended, so that the internal host name returns to ouvm2 from the current of hcp.ouvm2.abc.de?

Apparently I didn’t explain properly the matter from the very beginning. Sorry about that. Hopefully these explanations bring some more light into it.

What do you think?

hcp.ouvm2.abc.de

Thank you.

Context: I created and attached templates before.

In the same manner I also created the new cp template following your instructions.

Unfortunately the new cp template did not became available for the hcp.ouvm2.abc.de domain…

What folder did you create them`?

/usr/local/hestia/data/templates/web/nginx/php-fpm/, as advised above.