WordPress multisite on Debian

editing by pexels

setting up a new debian webserver with wordpress on vultr

to setup a new machine, I recommend always plan your system with a list of comments (which you can do either starting with “#” or “//”). For example setting up a simple standalone virtual machine with the following requirements:

  • debian
  • increasing the memory size (optional)
  • nginx
  • php 7
  • mariadb (mysql)
  • wordpress multisite

If you are finding a provider, you can either consider Amazon or Vultr. Below is a referral link to Vultr. It is recommended for new users as its clean, simple and fast.

If you are more adventurous, try adding

  • https via certbot
  • using ansible to automate
  • using terraform to generate the instance

you can download plugin from https://github.com/squat/terraform-provider-vultr
and install using https://www.terraform.io/docs/plugins/basics.html#installing-a-plugin

run memory extender swapfile

copy swapfile maker which I created to run (https://github.com/mirageglobe/jsf) into remote machine and run. Customise the following steps but on outline its approximately like this:

$ ssh <user>@<ip of server>

$ touch jsk.md

# copy the contents of jsk and run

$ sh jsf.sh deploy

adding wordpress cli

add the official wordpress cli

$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

$ chmod +x wp-cli.phar

$ sudo mv wp-cli.phar /usr/local/bin/wp

configure wordpress multi-site

run as root, and run wordpress installer

$ sudo su
$ wp core install –url=localhost:8000 –path=”/var/www/mywordpress” –title=Example –admin_user=supervisor –admin_password=strongpassword –admin_email=info@example.com

note that if you are running the statements as root user, you can use –allow-root

wpcli to convert single site to multisite

now you can visit the url by typing your ip address in the browser

$ wp core multisite-convert –path=/var/www/mywordpress

other additional notes

getting certbot for debian

when adding certbot for nginx on debian, you will need to use add the following to your deb package file

deb http://ftp.debian.org/debian stretch-backports main

reference : https://backports.debian.org/Instructions/

installing self-signed certificates for localhost

  • https://letsencrypt.org/docs/certificates-for-localhost/
  • https://www.digitalocean.com/community/tutorials/how-to-create-a-self-signed-ssl-certificate-for-nginx-in-ubuntu-16-04