Click here to Skip to main content
15,885,216 members
Articles / DevOps / Git

Create, Connect and Add Custom Domain to WordPress Bitnami Ready-to-Run Virtual Machine in Microsoft Azure

Rate me:
Please Sign up or sign in to vote.
5.00/5 (3 votes)
25 Oct 2016CPOL3 min read 14.3K  
In this article, I will describe how to Create WordPress Bitnami VM, how to connect to VM, how to add Custom Domain to that VM and important steps to follow after fresh installation.

Introduction

WordPress is one of the world’s most popular web publishing platforms for building blogs and websites. It can be customized via a wide selection of themes, extensions and plug-ins. More than 60 million websites are powered by WordPress.

There are many ways to host a WordPress website in Microsoft Azure like:

  • Create WordPress website using default WordPress Web App either scalable or simple. For that, you have to pay for DB additionally.
  • Host your DB in separate VM and connect your Web App.
  • Manually install everything from scratch in VM. Cost will be needing special attention.
  • Use Bitnami WordPress pre-configured Ready-to-Run Image. You are all set to go in less than 15 USD per month.

So, here, I’ll tell you about the recommended way – using Bitnami Stack.

Create Virtual Machine

First, login to your Azure portal and hit new, then select WordPress under the Virtual Machine category by Bitnami.

Image 1

Then hit Create.

After that, fill out some basic information like VM name, username, password and machine size, etc

Image 2

Then hit Purchase.

Image 3

After the installation, VM’s blade will open automatically.

Image 4

Under the Essentials, copy the Public IP address and try to access it in your browser.

Image 5

In just few clicks, WordPress site is up and running in Microsoft Azure cloud using Bitnami Stack.

Connect to Virtual Machine Using Git Bash

There are multiple ways to connect to VM resides in Azure cloud, you can connect through RDP (Remote Desktop Protocal), but why to install Desktop in Linux machine and create an RDP connection when you just have to work in Terminal?

To work with commands only, you can use many SSH clients like PuTTY, KiTTY, Xshell 5 and Git Bash, etc. In this tutorial, I’ll be using Git Bash, go ahead and install – if you haven’t already – I’ll wait here.

For a connection, you need three things from Azure portal:

  1. VM’s DNS Label
  2. Username (created during VM creation)
  3. Password (of that user)

Now open Git Bash and enter ssh connection command:

ssh username@DNSLabel

Now enter user’s password, you’ll be connected to VM.

Image 6

At this point, you have connection with your VM.

Add Custom Domain to VM

You cannot tell user or Search Engine to use Public IP to access your site. Plus, Public IP changes unless you pay extra bucks to get static Public IP.

To add custom domain to your Azure VM, you must have an idea of CNAME and A record.

As Public IP changes and we had to spend some money to get static Public IP, I’m using CNAME here instead of A record.

From your Resource Group in, which your VM is sitting, choose Public IP > Settings > Configuration, choose available DNS Name Label.

Image 7

Image 8

So, now your DNS name label will be ChoseName.VMLocation.cloudapp.azure.com. Meaning, you can access your website using this URL. Now, you have to align your custom domain with this DNS name label.

Now, go to your DNS provider site and manage DNS settings. In my case, it is NameCheap.

Fill the fields as follows (according to your DNS name label).

Image 9

Save the DNS settings and you’re all set!

Image 10

Now you can access your VM using your custom domain name.

Important Steps After Fresh Installation of WordPress Bitnami Stack

1. Change WordPress Username and Password

By default, Username will be “user” and Password will be “bitnami”, you have to change that.

First, using default username and password, you’ll be redirected to WordPress Dashboard, then go to users > add new and enter the information about new user – keeping in mind, role should be administrator.

Image 11

After creating new user, delete the old default user.

Image 12

2. Change MySQL Password

By default, root password of your MySQL database will be “bitnami”, you need to change that. First, connect to your VM and run this command:

stack/mysql/bin/mysqladmin -p -u root password <New Password>

You don’t need to change wp-config.php file, Bitnami will take care of it.

Image 13

3. Remove Bitnami Badge

When you install WordPress on Azure using Bitnami Cloud Image, you’ll see the Bitnami badge on your WordPress site.

Image 14

To remove this badge, first, connect to your VM, after authentication, run this command:

sudo /opt/bitnami/apps/wordpress/bnconfig --disable_banner 1

Image 15

Refresh your site, badge will be gone.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Systems Limited
Pakistan Pakistan
Computer Scientist, former Microsoft intern and currently working in Systems Limited. I like to explore many different technologies and love to write and talk about them.

Comments and Discussions

 
-- There are no messages in this forum --