LoginSignup
6
5

More than 5 years have passed since last update.

Ghostとは

Ghostとは、簡単で、しかもパワフルなBlogツールだそうです。

今回の環境

  • Ubuntu 14.04.1 LTS
  • Ghost 0.5.8

インストール

node.jsは0.10.30が、npmは、1.4.21が推奨されています。

が、気にせずapt-getでインストール!

$ sudo apt-get install nodejs npm
$ node -v
-bash: node: コマンドが見つかりません
$ nodejs -v
v0.10.25
$ npm -v
1.3.10

というわけで、普通にインストールすると nodejs という名前になってしまうので、

$ sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10

シンボリックリンクでもいいんだろうけど、一応。
若干古い感じがしますが、気にしないことにします。

$ curl -L https://ghost.org/zip/ghost-latest.zip -o ghost.zip
$ unzip -uo ghost.zip -d ghost
$ cd ghost
$ sudo npm install --production 
$ npm start

うにゅうにょと何か、画面に出て、developmentモードでサーバが立ち上がります。で、 http://localhost:2368 にアクセスすれば、Blogが見えるのですが、localhost以外からは見えないので、

$ diff -u config.js.org config.js
--- config.js.org       2015-01-23 03:05:11.000000000 +0900
+++ config.js   2015-01-23 03:14:50.000000000 +0900
@@ -10,8 +10,15 @@
     // When running Ghost in the wild, use the production environment
     // Configure your URL and mail settings here
     production: {
-        url: 'http://my-ghost-blog.com',
+        url: 'http://自分のに変更',
@@ -22,7 +22,7 @@

         server: {
             // Host to be passed to node's `net.Server#listen()`
-            host: '127.0.0.1',
+            host: '0.0.0.0',
             // Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
             port: '2368'
         }
@@ -58,7 +58,7 @@
         },
         server: {
             // Host to be passed to node's `net.Server#listen()`
-            host: '127.0.0.1',
+            host: '0.0.0.0',
             // Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
             port: '2368'
         },

こんなかんじにしておきます。
あと、urlも適宜変更してください

これで、developmentで動くことが確認できたので、一応productionでも確認しておきます。

$ npm start --production

Daemon化

このまま運用でもいいけど、落ちると困るので、Daemon化しておきます。Daemon化ツールは有名なところだと、foreverとか、ありますが、自分の環境だと、すでにsupervisorが導入済みなのでそちらを使いました。

6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5