Troubles with DNS multi-tenancy

Hello everyone.

I don’t remember when this started (I think I had it running OK before), but now, I have troubles with the DNS multi-tenancy, on a single bench.

I use certbot command to get and install an SSL certificate on a new site. And when I do so, all other sites become inaccessible (ssl error).

If I run certbot again to install on an existing site, this particular site goes up and running, all other sites fail down. This happens with every site/domain. In other words, only 1 site gets to work at a time.

I decided to re-do the steps to multi-tenancy:

bench config dns_multitenant on

bench setup supervisor

sudo ln -s `pwd`/config/supervisor.conf /etc/supervisor/conf.d/frappe-bench.conf

bench setup nginx

sudo ln -s `pwd`/config/nginx.conf /etc/nginx/conf.d/frappe-bench.conf

bench restart

Till this point, no site gets to work.

When I run:
frappe@erp:~$ sudo certbot --nginx -d a.site

This (a.site) only works.

Running cerbot again on (b.site), makes a.site goes down again.

What’s wrong with my multi-tenancy?

My mistake was installing the certificate using certbot, I should have used this instead:

sudo bench setup lets-encrypt a.site

Had to run the command for each site, then all was OK

Thanks to this tutorial

2 Likes

Actually, you can do with Certbot.
Run “sudo certbot --nginx” and don’t mention any site.
The generate/expand certificates for all the sites participating in the multi tenancy at once.

1 Like