WordPress Install: Difference between revisions

From Traxel Wiki
Jump to navigation Jump to search
(Created page with "Category:OpenDevOps Category:Hacking = Install = == VPS == * https://www.interserver.net/vps/ * $6 instance, 2 gigs, 2 terabytes, 1 core, 30 gigs * Debian 10 64 *...")
 
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 2: Line 2:
[[Category:Hacking]]
[[Category:Hacking]]


= Notes =


= Install =
== Killing Gravatar ==


== VPS ==
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/
* https://www.interserver.net/vps/
Line 13: Line 18:
* Reverse DNS: schneier.deadmandao.com
* Reverse DNS: schneier.deadmandao.com
* DNS: go to namecheap.com and point schneier.deadmandao.com at the IP
* 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 ==
= Initial Setup =


<pre>
<pre>
Line 25: Line 31:
</pre>
</pre>


== Apache Basic ==
= Apache Basic =


=== Setting Apache to Localhost ===
== Setting Apache to Localhost ==


On schneier:
On schneier:
Line 46: Line 52:
</pre>
</pre>


=== SSH Tunnel ===
== SSH Tunnel ==


<pre>
<pre>
Line 54: Line 60:
Now you should be able to point your local browser at localhost:8080 and see Apache2 on schneier.
Now you should be able to point your local browser at localhost:8080 and see Apache2 on schneier.


== Database ==
= Database =


=== DB Setup ===
== DB Setup ==


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




== WordPress (WordPress version) ==
= WordPress =


=== Install ===
== Install ==


<pre>
<pre>
Line 108: Line 114:
</pre>
</pre>


=== Configure ===
== Configure ==


Apparently the preceding only gets us to the point where we can run the install, which will be presented when we go to:
Apparently the preceding only gets us to the point where we can run the install, which will be presented when we go to:
Line 114: Line 120:
http://localhost:8080/wp-admin/install.php
http://localhost:8080/wp-admin/install.php


=== Move to 0.0.0.0:443 ===
== Move to 0.0.0.0:443 ==
 
=== Listen on All Addresses ===


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


<pre>
<pre>
Line 128: Line 136:
</pre>
</pre>


==== Install Let's Encrypt ====
=== Install Let's Encrypt ===


<pre>
<pre>

Latest revision as of 11:27, 27 February 2022


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