This is a 4 part series on configuring WordPress in Azure on its own dedicated VM.
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 http://wordpress.org 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/akdemolabs.co.uk
sudo chown -R $USER:$USER /var/www/akdemolabs.co.uk
sudo chmod -R 755 /var/www
Sudo chmod 757 /var/www/akdemolabs5.co.uk
Then get the latest build of WordPress and extract to the newly created folder:
Next Create the Database:
mysql -u root -p
CREATE DATABASE akdemolabs;
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:
- Over HTTP
- 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 https://www.digicert.com/easy-csr/openssl.htm 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 www.namecheap.com) and then copy the 3 files to the website folder:
And then create the following web config file on /etc/apache2/sites-avaialble:
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:
Redirect / https://akdemolabs.co.uk
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.
Go to your newly create website https://akdemolabs.co.uk (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:
And that’s it your WordPress blog is up and running.