環境
SakuraのVPS
[root@kouzu ~]# cat /etc/centos-release
CentOS release 6.5 (Final)
Apache proxy
<VirtualHost *:80>
DocumentRoot /path/to/ghost
ServerName kouzu.info
ServerAlias www.kouzu.info
# Rewrite Options
AllowEncodedSlashes On
RewriteEngine On
RewriteOptions inherit
RewriteCond %{HTTP_HOST} ^www\.kouzu\.info
RewriteRule ^/(.*)$ http://kouzu.info/$1 [R=301,L]
<Proxy *>
AddDefaultCharset off
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://127.0.0.1:2368/
ProxyPassReverse / http://127.0.0.1:2368/
</VirtualHost>
rc.local
cd /path/to/ghost && NODE_ENV=production && forever start index.js
Tips
config.js にて url変更後に再起動を実施
[root@kouzu ghost]# forever stop index.js
info: Forever stopped process:
data: uid command script forever pid logfile uptime
[0] WpVU /usr/bin/node index.js 19585 19587 /root/.forever/WpVU.log 0:0:35:18.512
[root@kouzu ghost]# forever list
info: No forever processes running
[root@kouzu ghost]# forever start index.js
warn: --minUptime not set. Defaulting to: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
info: Forever processing file: index.js
[root@kouzu ghost]# forever list
info: Forever processes running
data: uid command script forever pid logfile uptime
data: [0] v_jx /usr/bin/node index.js 19893 19896 /root/.forever/v_jx.log 0:0:0:3.262