사용자 도구

사이트 도구


ghost:install

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

다음 판
이전 판
ghost:install [2015/03/23 04:42] – 만듦 changwooghost:install [2015/03/23 05:06] (현재) – [proxy 모듈로 아파치에서 연결] changwoo
줄 67: 줄 67:
   },   },
   server: {   server: {
-    host: '0.0.0.0',+    host: '127.0.0.1',
     port: '2370'     port: '2370'
   },   },
줄 74: 줄 74:
 </code> </code>
  
 +서버로는 기본인 sqlite에서 mysql로 변경했습니다. socket 설정 등등을 맞춰 줍니다. server의 host는 ''npm start --production'' 명령을 사용했을 경우, 외부에서 확인 할 때는 '0.0.0.0'으로 변경해야 접속이 될 겁니다. 하지만 이후 아파치에서 프록시를 이용해 접속할 것이므로 host는 최종적으로 127.0.0.1로 맞춰 두어도 됩니다.
 +
 +<code>npm start --production</code>
 +
 +위 명렁으로 ghost가 동작할 때,
 +  * ''<nowiki>http://<server-ip>:2370</nowiki>'' 으로 접속해 봅니다.
 +  * 접속이 된다면 ''<nowiki>http://<server-ip>:2370/ghost</nowiki>''로 접속해서 관리자를 생성합니다.
 ===== supervisor를 사용한 자동 시작 ===== ===== supervisor를 사용한 자동 시작 =====
 +아무래도 서버가 실행될 때 ghost도 자동으로 실행되는 것이 바람직합니다. ''npm start --production'' 명령을 매번 입력할 수는 없습니다. 그러므로 [[http://supervisord.org/ |supervisor]]를 이용해 자동화합니다.
  
 +<code>
 +# sudo apt-get install supervisor
 +# service supervisor start
 +# vi /etc/supervisor/conf.d/ghost.conf
 +</code>
 +
 +<code>
 +[program:ghost]
 +command = node /media/storage/nodejs-deploy/ghost/index.js
 +directory = /media/storage/nodejs-deploy/ghost
 +user = ghost
 +autostart = true
 +autorestart = true
 +stdout_logfile = /var/log/supervisor/ghost.log
 +stderr_logfile = /var/log/supervisor/ghost_err.log
 +environment = NODE_ENV="production"
 +</code>
 +
 +''supervisorctl start ghost'' 명령으로 ghost를 실행해 봅니다.
 ===== proxy 모듈로 아파치에서 연결 ===== ===== proxy 모듈로 아파치에서 연결 =====
 +<code>
 +# apt-get install libapache2-mod-proxy-html libxml2-dev
 +# a2enmod proxy
 +# a2enmod proxy_balancer
 +# a2enmod proxy_http
 +# a2enmod proxy_html
 +# a2enmod xml2enc
 +# a2enmod deflate
 +# a2enmod headers
 +# a2enmod proxy_connect
 +# a2enmod proxy_ajp
 +</code>
 +
 +아파치 가상호스트 설정
 +<code>
 +<VirtualHost *:80>
 + ProxyPreserveHost On
 + ProxyPass / http://0.0.0.0:2370/
 + ProxyPassReverse / http://0.0.0.0:2370/
 + ServerName ghost.changwoo.pe.kr
 +</VirtualHost>
 +</code>
 +
 +혹시 작동되지 않는다면 도메인과 포트를 다시 한 번 잘 체크하여 봅니다. 기본 포트는 2368이지만 이 예에서는 2370으로 변경했음을 주지하세요.
  
 ===== 출처 및 참고 사이트 ===== ===== 출처 및 참고 사이트 =====
 +  * [[http://support.ghost.org/getting-started/ | Getting Started with Ghost]]
 +  * [[http://support.ghost.org/deploying-ghost  | Deploing Ghost]]
 +  * [[http://support.ghost.org/config | Configuring Ghost]]
 +  * [[https://www.digitalocean.com/community/tutorials/how-to-use-apache-http-server-as-reverse-proxy-using-mod_proxy-extension | How To Use Apache HTTP Server As Reverse-Proxy Using mod_proxy Extension]]
ghost/install.1427085725.txt.gz · 마지막으로 수정됨: 2015/03/23 04:42 저자 changwoo

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki