很久以来,我一直在尝试调试我的幽灵博客,如您所见here。
我已经取得了一些进展,该问题似乎与ghost的bootstrap套接字上的错误有关。
我在Digital Ocean服务器中的config.production.json
是:
{
"url": "https://www.mifitnessfacil.com",
"server": {
"port": 2369,
"host": "127.0.0.1"
},
"database": {
"client": "mysql",
"connection": {
"host": "localhost",
"user": "root",
"password": "foobar",
"database": "foobar"
}
},
"mail": {
"transport": "Direct"
},
"logging": {
"transports": [
"file",
"stdout"
]
},
"process": "systemd",
"paths": {
"contentPath": "/var/www/ghost/content"
},
"bootstrap-socket": {
"port": 8000,
"host": "localhost"
}
}
运行ghost run
时,我得到:
[2019-10-03 14:24:00] INFO Ghost is running in production...
[2019-10-03 14:24:00] INFO Your site is now available on https://www.mifitnessfacil.com/
[2019-10-03 14:24:01] INFO Ctrl+C to shut down
[2019-10-03 14:24:01] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2019-10-03 14:24:01] WARN Tries: 0
[2019-10-03 14:24:01] WARN Retrying...
[2019-10-03 14:24:01] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2019-10-03 14:24:01] WARN Tries: 1
[2019-10-03 14:24:01] WARN Retrying...
[2019-10-03 14:24:01] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2019-10-03 14:24:01] WARN Tries: 2
[2019-10-03 14:24:01] WARN Retrying...
[2019-10-03 14:24:01] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2019-10-03 14:24:01] INFO Ghost boot 3.299s
Ubuntu 18.04.3 LTS
上运行答案 0 :(得分:0)
请运行
sudo netstat -lnp | grep 8000
,然后查看端口8000是否已在使用中。如果是这样,请在ghost配置上更改端口,或禁用正在使用该端口的进程。
答案 1 :(得分:0)
从bootstrap-socket
中删除config.production.json
可以解决该问题,但是访问我的网站时我仍然得到502 Bad Gateway nginx/1.14.0 (Ubuntu)
。
答案 2 :(得分:0)
从bootstrap-socket
中删除config.production.json
并重新启动,很可能端口8000已被使用,或者引导程序无法在该处建立连接。
本质上在您的config.production.json
中反映出这一点:
{
"url": "https://www.mifitnessfacil.com",
"server": {
"port": 2369,
"host": "127.0.0.1"
},
"database": {
"client": "mysql",
"connection": {
"host": "localhost",
"user": "root",
"password": "foobar",
"database": "foobar"
}
},
"mail": {
"transport": "Direct"
},
"logging": {
"transports": [
"file",
"stdout"
]
},
"process": "systemd",
"paths": {
"contentPath": "/var/www/ghost/content"
}
}
希望这会有所帮助!