WordPress Install

From Traxel Wiki
Revision as of 11:27, 27 February 2022 by RobertBushman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Notes

Killing Gravatar

Here I am trying to drive a stake through the diseased black heart of centralization and WordPress defaults to a centralized avatar system.

https://wordpress.org/plugins/simple-local-avatars/

VPS

  • https://www.interserver.net/vps/
  • $6 instance, 2 gigs, 2 terabytes, 1 core, 30 gigs
  • Debian 10 64
  • KVM
  • Reverse DNS: schneier.deadmandao.com
  • DNS: go to namecheap.com and point schneier.deadmandao.com at the IP
    • Also have a CAA record: @.deadmandao.com, 0, issue letsencrypt.org

Initial Setup

$ ssh root@schneier.deadmandao.com
# apt update -y && apt upgrade -y && apt install -y sudo emacs-nox net-tools
# adduser bob
...
# usermod -G sudo bob
# exit

Apache Basic

Setting Apache to Localhost

On schneier:

$ sudo apt install apache2
$ cd /etc/apache2
$ sudo emacs -nw ports.conf
... change the Listen line from:
Listen 80
... to:
Listen 127.0.0.1:80
... save and exit
$ sudo service apache2 restart
$ sudo netstat -lnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.1:80            0.0.0.0:*               LISTEN      17467/apache2       

SSH Tunnel

$ ssh -L 8080:localhost:80 schneier.deadmandao.com

Now you should be able to point your local browser at localhost:8080 and see Apache2 on schneier.

Database

DB Setup

The config will need an account on a local database. We'll use MariaDB.

$ sudo apt install -y mariadb-client mariadb-server
$ sudo mariadb
> create user 'dmd-wordpress'@'localhost' identified by '[password]';
> create database dmd_wordpress;
> grant all on dmd_wordpress.* to 'dmd-wordpress'@'localhost';
> flush privileges;
> exit;
$ mariadb -p -u dmd-wordpress dmd_wordpress

Confirm that MariaDB is only listening on localhost (it should be, by default):

$ sudo netstat -lnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      17976/mysqld        


WordPress

Install

$ cd /home/bob
$ mkdir Downloads
$ cd Downloads
$ wget https://wordpress.org/latest.tar.gz
$ cd /var/www/
$ sudo tar -xvzf /home/bob/Downloads/wordpress-latest.tar.gz
$ sudo service apache2 restart

Now let's try hitting http://localhost:8080/wp-admin/install.php

... that's looking better.

Go through the config script, write the resulting config to a local file, then:

$ scp path/to/wp-config.php schneier.deadmandao.com:./
$ ssh schneier.deadmandao.com
$ cd /var/www/wordpress/
$ sudo cp /home/bob/wp-config.php ./

Configure

Apparently the preceding only gets us to the point where we can run the install, which will be presented when we go to:

http://localhost:8080/wp-admin/install.php

Move to 0.0.0.0:443

Listen on All Addresses

Note: As you do this, you'll have to keep updating the host url in the WordPress settings.

$ sudo emacs -nw /etc/apache2/ports.conf
... change
Listen 127.0.0.1:80
... to
Listen 80
... save and exit
$ sudo service apache2 restart

Install Let's Encrypt

sudo apt install snapd
sudo snap install core
sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot --apache -d www.deadmandao.com