8
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Ghostでブログ環境構築したい男たち

Last updated at Posted at 2015-12-07

Start my blog

NVM

node環境がある場合はGhostのインストールに進んでください。

$ sudo apt-get update
$ sudo apt-get install build-essential libssl-dev
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.2/install.sh | bash
$ source ~/.bashrc

install node.js & set default version

Ghostは0.10.30推奨(npm v1.4.21) http://docs.ghost.org/ja/installation/

$ nvm install 0.10.30
$ nvm alias default 0.10.30

確認してみる。

$ nvm use default
Now using node v0.10.30 (npm v1.4.21)

Ghost

ソースコードを取得します。

$ cd ~
$ curl -L https://ghost.org/zip/ghost-latest.zip -o ghost.zip

適当なディレクトリに展開してインストールします。

$ unzip -uo ghost.zip -d ghost
$ cd ghost
$ npm install --production

start Ghost(with development mode)

動作確認できたら、Ctrl+c で終了します。

$ npm start

download init script

$ sudo curl https://raw.githubusercontent.com/TryGhost/Ghost-Config/master/init.d/ghost -o /etc/init.d/ghost
  • GHOST_ROOT変数をGhostをインストールしたディレクトリに変更します。
  • DAEMON変数がwhich nodeの実行結果と一致するようにします。

create user & add permission

$ sudo useradd -r ghost -U
$ sudo chown -R ghost:ghost /path/to/ghost
$ sudo chmod 755 /etc/init.d/ghost

add service

$ sudo update-rc.d ghost defaults
$ sudo update-rc.d ghost enable

add group to login user

$ sudo adduser USERNAME ghost
8
10
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
8
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?