Ghost<\/strong>\u00a0is a free and open source blogging platform written in\u00a0node.js<\/em>, completely customizable and dedicated for publishing.<\/p>\n We’ll demonstrate the installation by logging into the server as\u00a0 On your server<\/strong>, run the following to update the package index, upgrade packages, and install\u00a0 The output from these commands should be similar to:<\/strong><\/p>\n Automatically, the package signing key will be added to the keyring (so that the packages downloaded can be verified), and the\u00a0PPA will be added to APT’s<\/strong>\u00a0 Now, let’s run:<\/p>\n Run\u00a0 Now we can install Ghost.<\/strong><\/p>\n Since Ghost is now considered “stable”, it can be installed through\u00a0 Ignore any warnings for now.<\/strong><\/p>\n Next, we will\u00a0start Ghost<\/strong>\u00a0and check if it’s working properly.<\/p>\n Output should look like this:<\/strong><\/p>\n It works! Use\u00a0Ctrl-C<\/strong>\u00a0to shut down Ghost, and move on to the next step: installing (and configuring) Nginx.<\/p>\n Nginx is very simple to install. Run the following command:<\/strong><\/p>\n Nginx will be configured to allow connection from anywhere in the wild to\u00a0port 80 (or 443, if using\u00a0SSL<\/em>)<\/strong>\u00a0on your server, which is then forwarded\u00a0(“proxied<\/em>“)<\/strong>\u00a0to Ghost. This is how people connect to your blog.<\/p>\n Configuring Nginx<\/strong>\u00a0is not that hard, either. Follow these steps to configure the\u00a0Ghost proxy.<\/strong><\/p>\n First, remove the default configuration file:<\/p>\n Then, make a new configuration file:<\/strong><\/p>\n Adapt the following lines to your need and use something like\u00a0 Symlink your configuration file:<\/strong><\/p>\n Restart Nginx:<\/strong><\/p>\n At this point,\u00a0Nginx is installed<\/strong>, configured, and running on your server.<\/p>\n Supervisor<\/strong>\u00a0is a process control system which allows you to run Ghost at startup without using init scripts. We will be installing Supervisor to manage Ghost.<\/p>\n To install Supervisor, run:<\/p>\n Then, create a new script file in\u00a0 Save and close the file.<\/strong><\/p>\n Next, we need to create a user for Ghost and give it permissions to access the Ghost files and database. Run the following commands:<\/p>\n Our setup is complete!<\/strong><\/p>\n Now you can\u00a0control Ghost<\/strong>\u00a0by executing\u00a0Prepare the server: Update packages, Install Node.js and NPM<\/h2>\n
root<\/code>, so that we will not need to add\u00a0
sudo<\/code>\u00a0before each command. If you are logged as another user, remember that you will need\u00a0
sudo<\/code>.<\/p>\n
nodejs<\/code>\u00a0and\u00a0
npm<\/code>.<\/p>\n
apt-get update\r\napt-get upgrade\r\n\r\napt-get install python software-properties-common gcc g++ make -y # auto install\r\nadd-apt-repository ppa:chris-lea\/node.js -y\r\n<\/code><\/pre>\n
gpg: keyring `\/tmp\/tmpvpe2ugzj\/secring.gpg' created\r\ngpg: keyring `\/tmp\/tmpvpe2ugzj\/pubring.gpg' created\r\ngpg: requesting key C7917B12 from hkp server keyserver.ubuntu.com\r\ngpg: \/tmp\/tmpvpe2ugzj\/trustdb.gpg: trustdb created\r\ngpg: key C7917B12: public key \"Launchpad chrislea\" imported\r\ngpg: Total number processed: 1\r\ngpg: imported: 1 (RSA: 1)\r\nOK\r\n<\/code><\/pre>\n
sources.list.d<\/code>.<\/p>\n
apt-get update # again \r\napt-get install nodejs -y\r\n<\/code><\/pre>\n
npm<\/code>\u00a0to\u00a0test the installation<\/strong>. You will see\u00a0
npm<\/code>‘s usage printed to the screen:<\/p>\n
Usage: npm <command>\r\n...\r\n...\r\nnpm@1.4.28 \/usr\/lib\/node_modules\/npm\r\n<\/code><\/pre>\n
Installation: Ghost and Nginx<\/strong><\/h2>\n
npm<\/code>. Install with the following command:<\/p>\n
npm install -g ghost --production\r\n<\/code><\/pre>\n
cd \/usr\/lib\/node_modules\/ghost\r\nnpm start --production\r\n<\/code><\/pre>\n
> ghost@0.5.2 start \/usr\/lib\/node_modules\/ghost\r\n> node index\r\n\r\nMigrations: Database initialisation required for version 003\r\n...\r\nMigrations: Complete\r\nGhost is running... \r\nYour blog is now available on http:\/\/my-ghost-blog.com \r\nCtrl+C to shut down\r\n<\/code><\/pre>\n
apt-get install nginx\r\n<\/code><\/pre>\n
cd \/etc\/nginx\/\r\nrm sites-enabled\/default\r\n<\/code><\/pre>\n
cd sites-available\r\ntouch ghost\r\n<\/code><\/pre>\n
nano<\/code>\u00a0or\u00a0
vi<\/code>\u00a0to paste it in (you’ll need to set\u00a0
server_name<\/code>\u00a0to your domain name):<\/p>\n
server {\r\n listen 80;\r\n server_name yourdomain.tld;\r\n access_log \/var\/log\/nginx\/yourdomain.tld.log; # if you want logging\r\n\r\n location \/ {\r\n proxy_set_header X-Real-IP $remote_addr;\r\n proxy_set_header HOST $http_host; \r\n proxy_pass http:\/\/127.0.0.1:2368;\r\n proxy_redirect off;\r\n }\r\n}\r\n<\/code><\/pre>\n
cd \/etc\/nginx\r\nln -s sites-available\/ghost sites-enabled\/ghost\r\n<\/code><\/pre>\n
service nginx restart\r\n<\/code><\/pre>\n
Finally: Start Ghost Automatically<\/strong><\/h2>\n
apt-get install supervisor\r\nservice supervisor start\r\n<\/code><\/pre>\n
\/etc\/supervisor\/conf.d\/ghost.conf<\/code>. Paste in these contents:<\/p>\n
[program:ghost]\r\ncommand = node \/usr\/lib\/node_modules\/ghost\/index.js\r\ndirectory = \/usr\/lib\/node_modules\/ghost\r\nuser = ghost\r\nautostart = true\r\nautorestart = true\r\nstdout_logfile = \/var\/log\/supervisor\/ghost.log\r\nstderr_logfile = \/var\/log\/supervisor\/ghost_err.log\r\nenvironment = NODE_ENV=\"production\"\r\n<\/code><\/pre>\n
useradd ghost\r\nchown -R ghost \/usr\/lib\/node_modules\/ghost\/\r\nsupervisorctl reread\r\nsupervisorctl update\r\n<\/code><\/pre>\n
supervisorctl start ghost<\/code>\u00a0and\u00a0
supervisorctl stop ghost<\/code>.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","manualknowledgebasecat":[106,109,242,247],"manual_kb_tag":[321],"_links":{"self":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2505"}],"collection":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/comments?post=2505"}],"version-history":[{"count":1,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2505\/revisions"}],"predecessor-version":[{"id":2506,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2505\/revisions\/2506"}],"wp:attachment":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/media?parent=2505"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manualknowledgebasecat?post=2505"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb_tag?post=2505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}