Last active
March 3, 2017 06:00
-
-
Save intrd/5bd32921459fd40f9985f9c15e361cdd to your computer and use it in GitHub Desktop.
Updating Ghost, Nodejs and Npmjs (any ver, works errorproof!)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Updating Ghost, Nodejs and Npmjs (any ver, works errorproof!) | |
| # @author intrd - http://dann.com.br/ | |
| # @license Creative Commons Attribution-ShareAlike 4.0 International License - http://creativecommons.org/licenses/by-sa/4.0/ | |
| Just for note.. '#'' is root and '$' is prod user | |
| $ forever list | |
| $ forever stop 0 | |
| # wget https://ghost.org/zip/ghost-latest.zip | |
| # mv ghost ghost_bk | |
| # unzip ghost-latest.zip -d ghost | |
| # cd ghost | |
| # mv content content_or | |
| # cd ../ghost_bk | |
| # cp -R content ../ghost | |
| # cp config.js ../ghost | |
| # cd .. | |
| # chown -R prod:prod ghost | |
| # cd ghost | |
| # apt-get update && apt-get upgrade (to update all the things) | |
| # npm install n -g (install n to upgrade nodejs, apt-get doesnt do this) | |
| # n stable (or n 6.9.4, you can see the lastver at https://nodejs.org/, i recommend to use stable not the lastest) | |
| # curl https://www.npmjs.com/install.sh | sh (update/install npm by curl) | |
| # chown -R prod:prod ../ghost | |
| $ npm install --production (update/install ghost dependencies, WARNs are OK) | |
| $ npm start --production | |
| $ forever list (to check for running or logfile for errors) | |
| done! | |
| If u need debug and start again.. | |
| $ rm -Rf node_modules | |
| $ npm cache clean | |
| $ npm install --production | |
| $ npm start --production | |
| To run forever.. | |
| NODE_ENV=production forever start index.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment