89.3 WordPress Basic Installation

20210219 Setting up a WordPress instance on Ubuntu is illustrated below using a new Azure virtual machine running Ubuntu 20.04 LTS (myhub.australiaeast.cloudapp.azure.com). We begin by connecting to the server using ssh:

ssh myhub.australiaeast.cloudapp.azure.com

Next ensure the software on the server is up-to-date:

sudo apt-get update 
sudo apt-get --yes dist-upgrade
sudo apt-get --yes install python3-pip
pip3 install wajig

You will need to reboot the server because of operating system updates:

sudo reboot

When you reconnect using ssh the PATH will also have been updated so that the wajig command will be available.

Next install wordpress and required software:

wajig install --yes wordpress php libapache2-mod-php mariadb-server php-mysql

The WordPress configuration file for Apache is then created:

sudo editor /etc/apache2/sites-available/wordpress.conf

Its contents should be the following, though you could use Alias /blog ... to retain current root site and utilise WordPress as /blog.

Alias / /usr/share/wordpress
<Directory /usr/share/wordpress>
    Options FollowSymLinks
    AllowOverride Limit Options FileInfo
    DirectoryIndex index.php
    Order allow,deny
    Allow from all
<Directory /usr/share/wordpress/wp-content>
    Options FollowSymLinks
    Order allow,deny
    Allow from all

We can then enable the WordPress site and modules for Apache:

sudo a2ensite wordpress
sudo a2enmod rewrite
wajig reload apache2

Your donation will support ongoing development and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2021 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0.