forem / selfhost

Selfhost your Forem Community on your own infrastructure 🎉
https://www.forem.com/get-started/
GNU Affero General Public License v3.0
1.43k stars 169 forks source link

Changing the domain URL #41

Closed MuruganDurai closed 2 years ago

MuruganDurai commented 2 years ago

Hey guys, First of all, Thanks for the great product. We are exploring the Forem for a couple of weeks now after self-hosting it in AWS with a subdomain of existing domain and it works great. Now, we would like to configure to a new domain, it would be really helpful if you guys could help me to change the domain.

jdoss commented 2 years ago

Changing the domain name would be a pretty manual process that you would have to do via SSH. It might be easier for you to launch a new Forem with the right domain name and delete the older one if you do not care about the content within the current one that you have.

That being said here is where you would have to edit the domain name on the current server and the services you would need to restart. My test domain name is qemu.forem.com and you would need to change the domain name in these two files as the root user:

[root@qemu (qemu.forem.com) forem]# fgrep qemu.forem.com * -R
configs/traefik/dynamic.toml:    rule = "Host(`qemu.forem.com`) && Method(`GET`, `POST`, `PUT`, `DELETE`, `PATCH`, `HEAD`)"
envs/rails.env:APP_DOMAIN=qemu.forem.com

and run:

# systemctl restart forem.service
# systemctl restart forem-traefik.service

and that should handle the server side configuration settings that handle the domain name. You need to make sure your DNS is pointed at this server and it resolves correctly before you restart forem-traefik.service.

I haven't test this, so your millage may vary. Please report your results.

MuruganDurai commented 2 years ago

@jdoss Thanks a ton. SSH without having the .pem key is crucial here. Any idea where to find this?

jdoss commented 2 years ago

There is no pem generated via AWS. We set https://github.com/forem/selfhost/blob/main/inventory/example/setup.yml#L5 which reads ~/.ssh/id_rsa.pub for the AWS playbook.

jdoss commented 2 years ago

@MuruganDurai I am going to close this issue out. If you have any other usage questions or issues, feel free to post them on our community site https://forem.dev