如何在ec2实例上重新启动ghost

时间:2014-08-19 22:21:34

标签: amazon-ec2 npm ghost-blog

我在EC2实例上运行了Ghost,我想在更改源代码后重新启动它。

我CD进入ghost目录并运行以下命令

sudo npm restart

我收到以下错误

> ghost@0.4.2 start /var/www/ghost
> node index


events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: listen EADDRINUSE
    at errnoException (net.js:904:11)
    at Server._listen2 (net.js:1042:14)
    at listen (net.js:1064:10)
    at net.js:1146:9
    at dns.js:72:18
    at process._tickDomainCallback (node.js:459:13)
    at process._tickFromSpinner (node.js:390:15)

npm ERR! ghost@0.4.2 start: `node index`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the ghost@0.4.2 start script.
npm ERR! This is most likely a problem with the ghost package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node index
npm ERR! You can get their info via:
npm ERR!     npm owner ls ghost
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.10.48-55.140.amzn1.i686
npm ERR! command "/usr/local/bin/node" "/usr/bin/npm" "restart"
npm ERR! cwd /var/www/ghost
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /var/www/ghost/npm-debug.log
npm ERR! not ok code 0

我真正做的就是将它们添加到主题文件夹中,并且它没有显示在管理员设置中,我认为重新启动鬼会有所帮助。

2 个答案:

答案 0 :(得分:2)

您是否使用了these说明?如果是这样,您可以使用以下命令重新启动Ghost:

pm2 restart ghost

在该命令中,ghost是pm2进程的名称,您可以从

获取该名称
pm2 list

答案 1 :(得分:0)

当我收到相同的错误消息时,我在同一端口上运行了一个节点实例。按sudo ps aux | grep node搜索进程并在可能的情况下终止该节点进程。