Hi @markstos I tried taking lsnode out the equation this weekend, but I’m facing two issues: (1) I now can’t get ghost start
to run successfully, but it seems ghost run
works (which I’m told should only be used for debugging). (2) Properly configuring OpenLiteSpeed to act as a reverse proxy (getting a 503).
I’m still tinkering to see if I can make any progress.
I recommend using the built-in support for starting/stopping/managing the service with systemd
. systemd
starts the service with ghost run
. Here’s the summary docs for ghost run
:
Run a Ghost instance directly (used by process managers and for debugging)
So while ghost run
is used for debugging, it’s also used by process managers like systemd
.
If you haven’t already, you can use ghost setup systemd
. Once that’s done, standard systemd commands can work on the service, including:
systemctl start 'ghost*'
systemctl status 'ghost*'
systemctl stop 'ghost*'
systemctl restart 'ghost*'
journalctl -u 'ghost*' # to look at the logs
1 Like
Hi @markstos I got it working. As mentioned, there were a number of problems, and considering I changed quite a few variables, I’m not 100% sure what actually the mysql issue was, but it’s solved.
-
I initially installed Ghost in a protected directory to which only the newly created Ghost user had access. I didn’t notice it at first, but the Ghost CLI needed access to that directory and the parent directories, which wasn’t ideal in its current location. So I moved Ghost from /home/blog.example.org
to /var/www/blog.example.org
.
-
When I ran ghost install
, I included the --no-setup-linux-user
flag, because I thought it was going to create another user specific for the Ghost blog, and I already had one. That said, it’s actually creating a ghost
user for the Ghost CLI, and perhaps that is helpful to have.
-
Per your recommendation, I completely scrapped the lsnode
part from the guide I followed, and I set up a reverse proxy in OpenLiteSpeed instead:
context / {
type proxy
handler ghost
addDefaultCharset off
}
The tricky part here was that I had to create this ghost
handler to expose the 2368
port on which Ghost is running. This configuration was added to OpenLiteSpeed in Server Configuration > External App.
- Previously, I wanted OpenLiteSpeed to start and run Ghost, because I thought that was the way to go, but per your recommendation, I just switched to using
systemd
, which I simply enabled/configured during the installation.
And here we are. Ghost is running, it’s using a remote MySQL 8 database, and I can finally sleep.
Thanks again for sticking with me here.
1 Like