Create a blog with Ghost certified by Bitnami Hosted on Microsoft Azure

ghost Apr 09, 2020

Ghost
Ghost is a blogging platform which simplifies the process of publishing. it is a good option for individual bloggers.

Bitnami
Bitnami is a packaged applications to run on any platform. it has many applications like wordpress, drupal, joomla etc.. which we can use to run on any platform and on clouds.

Microsoft Azure supports Bitnami. In azure account under “web app” if you search for bitnami you can see bitnami apps listed.


Choose the app “Ghost certified by Bitnami” and follow the configuration steps to deploy the app.

This will create a virtual machine in Azure of your choice windows or linux and installs bitnami ghost image in that.

Once the deployment is complete. Enter into virtual machine, in overview tab look for “DNS Name” click on configure.

and then enter the name in the DNS name label. refer below

Now your site is accessible.

To access ghost admin , Go to azure virtual machine → Boot diagnostics tab in serial log search for password. there you can find ghost default username and password.

To access admin panel → http://mathan-blog.eastasia.cloudapp.azure.com/ghost/

To Use Custom Domain:
go to your domain DNS zone, point your azure dns name to the custom domain you want. You could access the blog using custom domain.

Issues and solutions
Issue: Once you login to admin panel, you may see ‘X-Frame-Options’ to ‘sameorigin’.
Solution:
To login to azure virtual machine, find ssh command in “connect” tab

ssh -i <private key path> mathanka@mathan-blog.eastasia.cloudapp.azure.com

Once you login, do these steps:
https://docs.bitnami.com/aws/apps/ghost/administration/configure-domain/

To Install SSL certificate
Bitnami provides letsEncrypt SSL certification with it. To install, simply enter the command

sudo /opt/bitnami/bncert-tool

and follow the ssl configuration steps.
if you cannot find the tool installed, please check the below link

https://docs.bitnami.com/aws/how-to/generate-install-lets-encrypt-ssl/#alternative-approach

Issue — Mixed content Error
This issue happens mostly when you config custom domain and installed SSL. but content in ghost still serves from http url.
Solution
We have to add “HTTP:X-Forwarded-Proto” inside bitnami config file.
open ssh and go to this path

cd /opt/bitnami/apache2/conf/bitnami

open bitnami.conf file
Inside virtualhost:80 above the RewriteRule line, add

RewriteCond %{HTTP:X-Forwarded-Proto} =http

Inside <VirtualHost _default_:443>, add

RequestHeader set X-Forwarded-Proto "https"

then, we have to change the ghost url to https, To do that

cd /opt/bitnami/apps/ghost/htdocs

enter commands

ghost config url https://example.com

ghost config admin.url https://example.com

you can view the config in same folder in this file → config.production.json
Now Restart Ghost and apache using commands

ghost restart


Apache restart

sudo /opt/bitnami/ctlscript.sh restart apache

Thats it, Blog is live with no errors!!

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.