Ghost restart not working / Mailgun

After editing the config.production.json file, it does not work when I ghost restart.
I can’t find where the problem is.

config.production.json

{
    "url": "https://xxx.com",
    "server": {
        "port": 2368,
        "host": "127.0.0.1"
    },
    "database": {
        "client": "mysql",
        "connection": {
            "host": "xx.0.0.1",
            "user": "ghost-645",
            "password": "xxx",
            "database": "xx_prod"
        }
    },
    "mail": {
        "transport": "SMTP",
        "options": {
            "service": "Mailgun",
            "host": "smtp.eu.mailgun.org",
            "port": "587",
            "secure": true,
            "auth": {
                "user": "postmaster@your_domain.com",
                "pass": "your_password"
            }
        }
    }
}

See the line about the content folder not being owned by current user? That looks to be your problem.

Are you running as whatever user is set up as the ghost user? Did you accidentally change permissions when editing files?

1 Like

sudo chown -R ghost:ghost /var/www/sitename/content
I solved the problem this way. :slight_smile:

“ghost:ghost” your user name .

This problem has been resolved. I’m dealing with mail settings. It gives port error.

Try secure: false.
(Now writing more words to make the forum happy)

1 Like

Thank you for your answers. I set the value to false. There is log output like this.

yildo@ubuntu-2gb-fsn1-1:/var/www/sitename$ cat /home/yildo/.ghost/logs/ghost-cli-debug-2024-03-30            T13_48_49_985Z.log
Debug Information:
    OS: Ubuntu, v22.04.4 LTS
    Node Version: v18.20.0
    Ghost Version: 5.81.0
    Ghost-CLI Version: 1.26.0
    Environment: production
    Command: 'ghost restart'
Message: Ghost was able to start, but errored during boot with: (EADDRINUSE) Cannot start Ghost.
Context: Port 2368 is already in use by another program.
Help: Is another Ghost instance already running?
Stack: Error: Ghost was able to start, but errored during boot with: (EADDRINUSE) Cannot start Gh            ost.
    at ChildProcess.<anonymous> (/usr/lib/node_modules/ghost-cli/lib/utils/local-process.js:75:35            )
    at ChildProcess.emit (node:events:517:28)
    at emit (node:internal/child_process:944:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

yildo@ubuntu-2gb-fsn1-1:/var/www/sitename$

Something is on the GHost port. (Maybe another Ghost install?) Try ghost ls

nope, literally ghost ls

So then what’s listening on port 2368??

I was confused and didn’t understand.

var/www/sitename$ sudo netstat -tuln | grep 2368

tcp        0      0 127.0.0.1:2368          0.0.0.0:*               LISTEN


I set the port to 3000 and it worked. Will changing ports cause problems in the future?
@RyanF