Forem Creators and Builders 🌱

Varhal
Varhal

Posted on • Updated on

Change domain after install Forem on digitalocean (not solved)

Hey. Installed Forem on digitalocean, everything works fine. I installed it on a test domain to test and understand how it works.

How can I change the Forem domain to another after all the settings? And how can I generate an ssl certificate for a new domain?

Thank you!

Top comments (27)

Collapse
 
ellativity profile image
Ella (she/her/elle)

Hey @varhal - nice one on getting your Forem installed and working fine!

When you say you installed it on a test domain, do you also mean that you set that domain as forem_domain_name in your inventory/forem/setup.yml?

Collapse
 
varhal profile image
Varhal

I'll try to do that, thank you

Collapse
 
ellativity profile image
Ella (she/her/elle)

Oh, it was more of a question than an answer!

I was asking whether you already set the test domain as your forem_domain_name in your setup.yml file during the self-host process.

Thread Thread
 
varhal profile image
Varhal

Yes, i set text domain as forem_domain_name in file inventory/forem/setup.yml

Thread Thread
 
ellativity profile image
Ella (she/her/elle)

Thanks for clarifying!

If you want to change your domain from the test domain to your permanent domain, you need to change the forem_domain_name in your setup.yml file, and then return to the Self-Host installation instructions beginning at Step 7 where you'll rerun the Playbook for DigitalOcean install.

Don't forget to set up the DNS for your new domain, and restart the Forem Traefik service (sudo systemctl restart forem-traefik.service), too!

Thread Thread
 
varhal profile image
Varhal • Edited

If i restart the playbook, a new image will be created. After creating a new image, settings, content and this data will not be lost?

Thread Thread
 
ellativity profile image
Ella (she/her/elle) • Edited

If you want to keep your Test Forem, but turn it into your Real Forem? Then you may want to follow these directions to make the server-side change.

If you're not comfortable making those changes to the server then your best bet is to create a new Forem by running the playbook again.

Thread Thread
 
varhal profile image
Varhal

After entering the commands from the tutorial, an input field is displayed on the command line, should I write a new domain here? If so, in what format?

Alt text of image

Collapse
 
varhal profile image
Varhal

Hey @ellativity !

Maybe there is a more detailed instruction on how to log in as root to the server and run the command to change the domain?

I think many will be useful, thanks

Collapse
 
ellativity profile image
Ella (she/her/elle) • Edited

Hey @varhal , as this is a question regarding Forem self-host, the instructions here are provided on the assumption that you've already figured out how to log into your server as root, based on the information provided in the Self-Host set up guide.

The instructions @jdoss provided in the issue, combined with the SSH examples in the Self-Host repo, detail exactly what it is you have to do.

Thread Thread
 
varhal profile image
Varhal • Edited

Hey @ellativity , I read these instructions, the problem is that it is not authorized as root

ssh -i ~/.ssh/forem root@104.138.6.116
or
ssh -i /root/.ssh/forem root@104.138.6.116

Rusult
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

Tried creating new keys and more, nothing helped

Thread Thread
 
ellativity profile image
Ella (she/her/elle)

Hey @varhal , these are familiar errors. Let's see if we can figure out how to get past them:

@andygeorge has suggested in the past that

if you configured your SSH key with a passphrase, you may need to do this first to unlock/add the key to your local ssh auth agent:

ssh-add -K ~/.ssh/forem
Enter fullscreen mode Exit fullscreen mode

Using -k for Linux or -K for macOS.

Can you give that a try and see how it goes for you? Just to confirm, you should be using the key that you created under Step 5 of the Manual Installation before you run your playbook to create your instance.

Thread Thread
 
varhal profile image
Varhal

I deleted Fedora CoreOS image from digitalocean and destroy droplet. Then I used the command on linux:

ssh-add -k ~/.ssh/forem
Result:
Identity added: /root/.ssh/forem

Then I started the playbook and created an instance. I tried to log in as root:

ssh -i ~/.ssh/forem root@143.198.19.221
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

The problem was not solved

Thread Thread
 
ellativity profile image
Ella (she/her/elle)

Can you try logging in as core and see what happens?

Thread Thread
 
ellativity profile image
Ella (she/her/elle)

Also, if you destroyed your Droplet you could reconfigure your Forem with your chosen URL before rerunning the playbook.

That's one way around this issue, for now πŸ˜‰

Thread Thread
 
varhal profile image
Varhal • Edited

The authorization is successful under the core user.

I have a large wordpress site. I want to migrate from wordpress to forem. But first, I need to create a website on forem, transfer all the information, make the necessary settings, and only then change the domain to the main one.

Thread Thread
 
ellativity profile image
Ella (she/her/elle)

Ah, I see! Thanks for clarifying.

And thanks for confirming that core works for you ☺️

Thread Thread
 
varhal profile image
Varhal

I understand that there is no solution to this problem yet? Maybe I can log into the site using the ip, not the domain? Or, for example, bypass the system by binding another domain (by editing DNS records). There must be another way out)

Thread Thread
 
ellativity profile image
Ella (she/her/elle)

Sorry, @varhal , I understood that you had successfully logged in as core?

Thread Thread
 
varhal profile image
Varhal

Yes, i authorization is successful under the core user. But need under root user

Thread Thread
 
ellativity profile image
Ella (she/her/elle)

I haven't tried these instructions for myself but I'm curious if you already tried to SSH using core instead of root and then su - root?

Thread Thread
 
ellativity profile image
Ella (she/her/elle)

Please remember that Forem Self-host is intended to be self-administrated, so while we will assist you to use Forem we don't provide instructions on how to use Linux:

Please note that Forem is a complex piece of software, and hosting and managing it in a cloud environment is non-trivial. While the recipes and scripts here are expected to work for the limited scenarios we tested against, use and modification of the recipes, or altering the deployed environment, may require familiarity with the following layers of the tech stack we built with, and ongoing maintenance of the deployed system may require interacting with any of these technologies:
-Ansible
-Your chosen cloud provider - both CLI and UI use
-Python 3 and pip3
-systemd
-Podman
-General Linux administration, especially Fedora CoreOS, including:
-Butane
-Ignition

Thread Thread
 
varhal profile image
Varhal

Thanks for the answer. I have experience using the terminal on linux. What password should I enter when using the command su ? Doesn't accept passwords

Thread Thread
 
varhal profile image
Varhal

I seem to understand how it works, thank you. I will write instructions for other users on how to change the domain if everything works out

Thread Thread
 
ellativity profile image
Ella (she/her/elle)

You've got it? Hope this works out!

Thread Thread
 
varhal profile image
Varhal

Hey @ellativity !

Domain change succeeded! After changing the domain, all images in articles and avatars were no longer displayed, since they refer to the old domain. Could you help me with this?

Collapse
 
varhal profile image
Varhal

The question is open!