I’ve recently had the pleasure of meeting the Ghost blogging project. After a couple of weeks with doubts, I needed to try to make an assessment of how the platform is. The first problem is that Ghost is being based on node.js and today few hosting providers allow installing this application on their shared hosting.
Many users think WordPress has grown from a blogging platform to be a full CMS and too complex for everyday use and simple that many users need. That is probably the gap Ghost comes to occupy: blogging platform exclusively for bloggers. So let’s do a little walkthrough about how to install ghost on azure web sites.
- Get Ghost prebuilt from https://ghost.org/download/
- Get Nodejs (0.10 or above) from http://nodejs.org
- Get, if you don´t have one, an Azure Trial
- Get node Azure command line executing “npm install azure-cli –g” on Command Prompt
Configure Azure Command Line
To configure Azure Client we need to download azure account configuration, for that execute on the command prompt:
This launches a browser, you need to sign in and get cert. After that we import the account configuration for setup locally changing [filename] for the path of the cert obtained on the before step:
Ready Ghost to upload
Unzip the Ghost prebuilt code downloaded into a folder. At this moment the prebuilt version is 0.3.3 and it can´t be uploaded to azure web sites. We need to fix some data. On the package.json upload the values of this package “express” to “3.4.0” and “express-hbs”: “0.5.0”. If you have higher version of those package don´t edit json file. After that just need another change on server.js from “ghost.config().server.port” to “process.env.PORT || ghost.config().server.port” at “server.listen” declaration.
Then, on the unzip path command prompt:
Create on root unziped folder a server.js file and write inside “var GhostServer = require(‘./index’);”
Config Ghost before upload
Copy config.example.js to config.js and made some changes:
On the production section we need to change url, user/pass for email and modify port. ‘process.env.PORT’ is how iisnode and Azure get the Port number.
Now it´s Git time!
If all run correctly we have now our ghost core on azure but if azure can´t deploy well we should try to run ghost locally starting local server with “npm start” command and see the errors
As example i made my own copy of my blog on Ghost & Azure: Rfsouto Site on Azure!