Setting up Mastodon for a subdomain when the main server has Apache


#1

Hi, I am in the process of configuring Mastodon in a subdomain. I am following the guide.

.env.production has been already configured:

LOCAL_DOMAIN=confederac.io
WEB_DOMAIN=red.confederac.io

Proof that it works: https://red.confederac.io/

However, I’m stuck in the last step: Configuring confederac.io. The documentation says:

With nginx, it would be as simple as adding:

location = /.well-known/host-meta {
return 301 https://social.example.org$request_uri;
}

However, the (Debian) server running confederac.io uses Apache, and this is where I get lost. What configuration file do I need to edit (there are several) and what should I add?


#2

After a bit of trial and error, I think I have found it:

In 000-default-le-ssl.conf add

Redirect permanent /.well-known/host-meta https://red.confederac.io/.well-known/host-meta