Installing WordPress on an Azure Ubuntu VM – Part 3

This is a 4 part series on configuring WordPress in Azure on its own dedicated VM.

Part 1 – Deploy an Azure Ubuntu VM
Part 2 – Install LAMP on the VM
Part 3 – Install and configure WordPress
Part 4 – Fixing the “quirks”

Part 3 – Install and configure WordPress

There are a few ways to install WordPress on Ubuntu however the way I like to do it is to download the latest build from and then extract to my local PC and the copy the files up to

Firstly create the folder as to where WordPress will be installed to:

sudo mkdir -p /var/www/
sudo chown -R $USER:$USER /var/www/
sudo chmod -R 755 /var/www
Sudo chmod 757 /var/www/


Then get the latest build of WordPress and extract to the newly created folder:

wget -c
tar -xzvf latest.tar.gz
sudo rsync -av wordpress/* /var/www/

Next Create the Database:

mysql -u root -p
CREATE USER AT365user@localhost IDENTIFIED BY ‘GHT56&*aaa_KJd’;
GRANT ALL PRIVILEGES ON akdemoalbs.* TO AT365user@localhost;

Create the Website:

There are two ways to publish your site:

  1. Over HTTP
  2. Over HTTPS

I tend to create my site using HTTPS and have URL Redirects for HTTP.

If you are wanting to create a site secured by an SSL certificate follow these steps:

Enable the SSL Module by running:

sudo a2enmod ssl

Then you need to create the CSR For your certificate I used the following link to create the command I needed to generate my CSR:


Please remember if you plan to have multiple names on your website to add these to the CSR.

Create an SSL certificate (I use and then copy the 3 files to the website folder:


And then create the following web config file on /etc/apache2/sites-avaialble:

<VirtualHost _default_:443>
DocumentRoot /var/www/
SSLEngine on
SSLCertificateFile /var/www/
SSLCertificateKeyFile /var/www/
SSLCACertificateFile /var/www/
<Directory /var/www/>
AllowOverride All


I called mine /etc/apache2/sites-available/akdemolabs_SSL.conf


Save the site as it is and then run:

sudo a2ensite akdemolabs_SSL.conf this will enable the site and then prompt you to restart the apache2 service by running:

sudo service apache2 restart all being well apache will restart and the site will be enabled

This will enable the newly created SSL site



Setting up the URL Redirect

The URL redirect is just a simple edit to the config file and then a restart of the apache2 services:

Run sudo nano /etc/apache2/sites-avialble/akdemolabs_SSL.conf and add the following to the top of the config:

<VirtualHost *:80>
Redirect /
<VirtualHost _default_:443>
Rest of the initial conf file


Once Saved run: sudo services apache2 restart to restart apache and then try and browse to the site on Port 80 and you will be redirected to the SSL Site.

Configure WordPress

Go to your newly create website (in this case)

And then follow the on screen instructions:

In order to configure WordPress you will need to specify the Database details created earlier on in this guide:

User: AT365user
Password: GHT56&*aaa_KJd’;
Database: Aakdemolabs








And that’s it your WordPress blog is up and running.

Leave Comment

Your email address will not be published. Required fields are marked *