How broker MQTT and host website on same droplet?
I already have a website set up and running well on a droplet. I have a domain name pointing at this website, which I installed using the Wordpress One-Click droplet installer.
I would also like to setup an MQTT broker. Following the instructions here: https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-the-mosquitto-mqtt-messaging-broker-on-debian-10
I was able to set up a localhost MQTT broker with no issues. However, if I try to use certbot as detailed in the instructions, it fails on port 80. Probably because I already have certbot configured for my website using apache, as explained here: https://marketplace.digitalocean.com/apps/wordpress#enable-https
I have two questions, which are probably related.
- How do I set up a subdomain for my MQTT host, like mqtt.myhost.com? I can easily setup a cname record pointing to myhost.com, but that’s just an alias.
- How do I configure the standalone certbot certificates for MQTT? I tried just using the certificates generated for my website, but I just get an “Error: Connection refused” when I try to use mosquitto_pub.