Host website on the same domain as the control panel?

TL;DR: if the control panel is panel.example.com, how do you use example.com as a website without breaking SSL renewal for the panel itself?

Hello all,
I just had a bit of a hiccup with my current setup, and since I haven’t moved my “main” domains to the server that I use Hestia on, I figured I’d ask so I can arrange things properly before the big jump.

To make a long story short, my control panel lives on panel. example. com, and I had added example. com as a web/mail domain to a non-admin user (as recommended).
The problem is that prevented the SSL certificate for the control panel from being renewed. When I ran v-add-letsencrypt-host, I got this:

Error: Unable to add panel. example. com. example.com belongs to a different user
Error: web domain panel. example. com doesn't exist

(I had to break the addresses down to get Discourse to post this)

Note that this is not an issue with /etc/hosts as mentioned in another thread, as the machine’s hostname is correctly set up.

In order to work around the problem, I had to remove the domain from the other user; it wasn’t a big deal as I still hadn’t moved anything there yet. I then run v-add-letsencrypt-host again, which worked just fine.

Now my question is: if I add the domain back to the non-admin user, I’ll probably be in the same situation when the certificate expires again.
What is the proper way to add the domain that also hosts the control panel so that it can be used just like any others? Should I just dedicate a specific domain to the panel?

I looked in the documentation but I can’t seem to find anything specific about this; apologies if it’s there and I missed it!
Any hints towards figuring this out would be most welcome. :slight_smile:

Thanks in advance!

Yes :wink:

Two options:

Option 1

Allow different users to use subdomains that belongs to another user. In your case, example.com belongs to user whatever so admin user can’t use panel.example.com as a web domain. You can modify option Enforce subdomain ownership to No to allow different users to use subdomains for the same domain.

From Web UI:

Server settings -> Configure -> Security -> Policies -> Domains and change to No the option Enforce subdomain ownership

From command line:

v-change-sys-config-value ENFORCE_SUBDOMAIN_OWNERSHIP no

Option 2

Remove panel.example.com from admin user and add it to the same user that already has example.com. Once done, just execute v-add-letsencrypt-host and that’s all.

No.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.