{"id":221,"date":"2014-10-16T09:55:37","date_gmt":"2014-10-16T09:55:37","guid":{"rendered":"http:\/\/adrhc.go.ro\/wordpress\/?p=221"},"modified":"2017-10-07T17:25:08","modified_gmt":"2017-10-07T15:25:08","slug":"install-configure-ghost","status":"publish","type":"post","link":"https:\/\/adrhc.go.ro\/blog\/install-configure-ghost\/","title":{"rendered":"Install &#038; configure ghost"},"content":{"rendered":"<p><a title=\"Installing ghost on linux (official)\" href=\"http:\/\/support.ghost.org\/installing-ghost-linux\/\">Installing ghost on linux (official)<\/a><br \/>\n<a title=\"Compiling nodejs\" href=\"https:\/\/adrhc.go.ro\/wordpress\/compiling-nodejs\/\">Compiling nodejs<\/a><\/p>\n<pre class=\"brush:bash shell;toolbar: false;auto-links: true\">cd \/ffp\/opt\/\r\nrm -r ghost\r\n#rm ghost.zip\r\n#curl -L -k https:\/\/ghost.org\/zip\/ghost-latest.zip -o ghost.zip\r\nunzip -uo ghost.zip -d ghost\r\ncd \/ffp\/opt\/ghost\r\nfind . -type f -exec sed -i s\/\"\\\/usr\\\/bin\\\/bash\"\/\"\\\/ffp\\\/bin\\\/bash\"\/ {} \\;\r\nfind . -type f -exec sed -i s\/\"\\\/usr\\\/bin\\\/sh\"\/\"\\\/ffp\\\/bin\\\/sh\"\/ {} \\;\r\nfind . -type f -exec sed -i s\/\"\\\/usr\\\/bin\\\/env\"\/\"\\\/ffp\\\/bin\\\/env\"\/ {} \\;\r\nfind . -type f -exec sed -i s\/\"\\\/bin\\\/bash\"\/\"\\\/ffp\\\/bin\\\/bash\"\/ {} \\;\r\nfind . -type f -exec sed -i s\/\"\\\/bin\\\/sh\"\/\"\\\/ffp\\\/bin\\\/sh\"\/ {} \\;\r\nfind . -type f -exec sed -i s\/\"\\\/bin\\\/env\"\/\"\\\/ffp\\\/bin\\\/env\"\/ {} \\;\r\nfind . -type f -exec sed -i s\/\"\\\/ffp\\\/ffp\\\/\"\/\"\\\/ffp\\\/\"\/ {} \\;\r\n#cp -r \/ffp\/opt\/ghost ~\/temp\/ghost\r\n\/ffp\/opt\/nodejs\/bin\/npm install --production\r\n\r\n#ERROR1:\r\n\tsh: \/usr\/local\/zy-pkgs\/ffproot\/ffp\/opt\/ghost\/node_modules\/sqlite3\/node_modules\/.bin\/node-pre-gyp: \/usr\/bin\/env: bad interpreter: No such file or directory\r\n#SOLUTION1:\r\n\t#See something like https:\/\/registry.npmjs.org\/sqlite3\/2.2.7 in error message.\r\n\tcd ~\/temp\r\n\twget http:\/\/registry.npmjs.org\/sqlite3\/-\/sqlite3-2.2.7.tgz\r\n\tmkdir sqlite3-2.2.7\r\n\tcd sqlite3-2.2.7\r\n\tcp ..\/sqlite3-2.2.7.tgz .\r\n\ttar xvzf .\/sqlite3-2.2.7.tgz\r\n\trm sqlite3-2.2.7.tgz\r\n\tfind . -type f -exec sed -i s\/\"\\\/usr\\\/bin\\\/bash\"\/\"\\\/ffp\\\/bin\\\/bash\"\/ {} \\;\r\n\tfind . -type f -exec sed -i s\/\"\\\/usr\\\/bin\\\/sh\"\/\"\\\/ffp\\\/bin\\\/sh\"\/ {} \\;\r\n\tfind . -type f -exec sed -i s\/\"\\\/usr\\\/bin\\\/env\"\/\"\\\/ffp\\\/bin\\\/env\"\/ {} \\;\r\n\tfind . -type f -exec sed -i s\/\"\\\/bin\\\/bash\"\/\"\\\/ffp\\\/bin\\\/bash\"\/ {} \\;\r\n\tfind . -type f -exec sed -i s\/\"\\\/bin\\\/sh\"\/\"\\\/ffp\\\/bin\\\/sh\"\/ {} \\;\r\n\tfind . -type f -exec sed -i s\/\"\\\/bin\\\/env\"\/\"\\\/ffp\\\/bin\\\/env\"\/ {} \\;\r\n\tfind . -type f -exec sed -i s\/\"\\\/ffp\\\/ffp\\\/\"\/\"\\\/ffp\\\/\"\/ {} \\;\r\n\ttar czf sqlite3-2.2.7.tgz package\r\n\tnpm install sqlite3-2.2.7.tgz\r\n\r\ncd \/ffp\/opt\/ghost\r\n\/ffp\/opt\/nodejs\/bin\/npm install --production\r\nnpm install forever -g\r\nnpm install mysql -g\r\ncd \/ffp\/opt\/nodejs\/lib\/node_modules\r\nfind . -type f -exec sed -i s\/\"\\\/usr\\\/bin\\\/bash\"\/\"\\\/ffp\\\/bin\\\/bash\"\/ {} \\;\r\nfind . -type f -exec sed -i s\/\"\\\/usr\\\/bin\\\/sh\"\/\"\\\/ffp\\\/bin\\\/sh\"\/ {} \\;\r\nfind . -type f -exec sed -i s\/\"\\\/usr\\\/bin\\\/env\"\/\"\\\/ffp\\\/bin\\\/env\"\/ {} \\;\r\nfind . -type f -exec sed -i s\/\"\\\/bin\\\/bash\"\/\"\\\/ffp\\\/bin\\\/bash\"\/ {} \\;\r\nfind . -type f -exec sed -i s\/\"\\\/bin\\\/sh\"\/\"\\\/ffp\\\/bin\\\/sh\"\/ {} \\;\r\nfind . -type f -exec sed -i s\/\"\\\/bin\\\/env\"\/\"\\\/ffp\\\/bin\\\/env\"\/ {} \\;\r\nfind . -type f -exec sed -i s\/\"\\\/ffp\\\/ffp\\\/\"\/\"\\\/ffp\\\/\"\/ {} \\;\r\n\r\n#Create mysql DB for ghost\r\nmysql -p\r\nCREATE DATABASE ghost CHARACTER SET utf8;\r\nGRANT ALL ON ghost.* TO 'ghost'@'%' IDENTIFIED BY 'ghost' WITH GRANT OPTION;\r\nFLUSH PRIVILEGES;\r\nexit\r\n\r\nsed -i s#\\\"\\\/shared\\\/img#\\\"\\\/blog\\\/shared\\\/img# \/ffp\/opt\/ghost\/core\/built\/scripts\/ghost-dev.js\t \t \r\nsed -i s#\\\"\\\/shared\\\/img#\\\"\\\/blog\\\/shared\\\/img# \/ffp\/opt\/ghost\/core\/built\/scripts\/templates-dev.js\t \t \r\nsed -i s#\\\"\\\/shared\\\/img#\\\"\\\/blog\\\/shared\\\/img# \/ffp\/opt\/ghost\/core\/built\/scripts\/ghost.min.js\r\n\r\n#\/ffp\/opt\/ghost\/config.js\r\n\turl: 'http:\/\/adrhc.go.ro\/blog',\r\n\tdatabase: {\r\n\t\tclient: 'mysql',\r\n\t\tconnection: {\r\n\t\t\thost: 'localhost',\r\n\t\t\tuser: 'ghost',\r\n\t\t\tpassword: 'ghost',\r\n\t\t\tdatabase: 'ghost',\r\n\t\t\tcharset: 'utf8'\r\n\t\t}\r\n\t},\r\n\r\n#Apache config:\r\n#\tProxyPass\t\t\t\/blog\/\t\t\thttp:\/\/127.0.0.1:2368\/blog\/\r\n#\tProxyPassReverse\t\/blog\/\t\t\thttp:\/\/127.0.0.1:2368\/blog\/\r\n\r\n#Running ghost in production mode:\r\ncd \/ffp\/opt\/ghost\r\nNODE_ENV=production npm start\r\n#Running ghost in development mode:\r\ncd \/ffp\/opt\/ghost\r\nnpm start\r\n#Running ghost in production mode (first put export NODE_ENV=production in ~\/.profile):\r\ncd \/ffp\/opt\/ghost\r\n\/bin\/nice --8 npm start\r\n#Running ghost in production mode (first put export NODE_ENV=production in ~\/.profile):\r\ncd \/ffp\/opt\/ghost && \/bin\/nice --8 forever -o \/ffp\/var\/log\/ghost.log start index.js\r\n#cd \/ffp\/opt\/ghost && forever stop index.js\r\n<\/pre>\n<p><a href=\"http:\/\/adrhc.go.ro\/blog\/\" title=\"posts\" target=\"_blank\">posts page<\/a><br \/>\n<a href=\"http:\/\/adrhc.go.ro\/blog\/ghost\/signin\/\" title=\"login page\" target=\"_blank\">login page<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installing ghost on linux (official) Compiling nodejs cd \/ffp\/opt\/ rm -r ghost #rm ghost.zip #curl -L -k https:\/\/ghost.org\/zip\/ghost-latest.zip -o ghost.zip unzip -uo ghost.zip -d ghost cd \/ffp\/opt\/ghost find . -type f -exec sed -i s\/&#8221;\\\/usr\\\/bin\\\/bash&#8221;\/&#8221;\\\/ffp\\\/bin\\\/bash&#8221;\/ {} \\; find . -type [&hellip;]<\/p>\n<div class=\"link-more\"><a href=\"https:\/\/adrhc.go.ro\/blog\/install-configure-ghost\/#more-221\" class=\"more-link\">Continue reading &#10142; <span class=\"screen-reader-text\">Install &#038; configure ghost<\/span><\/a><\/div>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,6,11,163],"tags":[],"class_list":["post-221","post","type-post","status-publish","format-standard","hentry","category-compiling-from-source","category-configuration","category-linux","category-nsa310"],"_links":{"self":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/comments?post=221"}],"version-history":[{"count":0,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/221\/revisions"}],"wp:attachment":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/media?parent=221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/categories?post=221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/tags?post=221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}