WordPress » History » Version 1
Redmine Admin, 10/25/2026 04:30 PM
| 1 | 1 | Redmine Admin | # WordPress sites |
|---|---|---|---|
| 2 | |||
| 3 | Created by `~/deploy/add-wordpress-site.sh <domain> [short-name] [--no-egress] [--force] [--skip-npm-api]`. |
||
| 4 | |||
| 5 | Short name derives from the domain (`www.mdsdefense.com` โ `mdsdefense`). |
||
| 6 | |||
| 7 | Per site: |
||
| 8 | |||
| 9 | | Object | Name | Notes | |
||
| 10 | | --- | --- | --- | |
||
| 11 | | Network | `net-<name>` | `net-<name>.network` | |
||
| 12 | | MariaDB | `db-<name>` | `mariadb:11`, no PublishPort | |
||
| 13 | | WordPress | `site-<name>` | `wordpress:php8.3-apache`, no PublishPort | |
||
| 14 | | DB volume | `db-<name>-data` | `/var/lib/mysql` | |
||
| 15 | | WP volume | `wp-<name>-content` | `/var/www/html` (core, themes, plugins, uploads, `.htaccess`) | |
||
| 16 | | Secrets | `<name>-db-root-password` | env `MYSQL_ROOT_PASSWORD` in db | |
||
| 17 | | | `<name>-db-password` | env `MYSQL_PASSWORD` (db) + `WORDPRESS_DB_PASSWORD` (site) | |
||
| 18 | |||
| 19 | ``` |
||
| 20 | # Themes / plugins / uploads on the host |
||
| 21 | ls ~/.local/share/containers/storage/volumes/wp-<name>-content/_data/wp-content/themes/ |
||
| 22 | |||
| 23 | # wp-config.php reads the DB password from the env at every request โ nothing to edit |
||
| 24 | podman exec site-<name> grep -n DB_PASSWORD /var/www/html/wp-config.php |
||
| 25 | |||
| 26 | # PHP upload limit lives in the volume's .htaccess (php_value block), not in the image |
||
| 27 | podman exec site-<name> cat /var/www/html/.htaccess |
||
| 28 | ``` |
||
| 29 | |||
| 30 | MariaDB access (client only exists inside the container): |
||
| 31 | |||
| 32 | ``` |
||
| 33 | podman exec -it db-<name> sh -c 'mariadb -uroot -p"$MYSQL_ROOT_PASSWORD"' |
||
| 34 | podman exec -it db-<name> mariadb -uroot -p'PASSWORD' # single quotes: + and = |
||
| 35 | podman exec -it db-<name> mariadb -uroot -p"$(podman secret inspect --showsecret --format '{{.SecretData}}' <name>-db-root-password)" |
||
| 36 | ``` |
||
| 37 | |||
| 38 | ``` |
||
| 39 | SELECT user, host, plugin FROM mysql.user; |
||
| 40 | ALTER USER 'wordpress'@'%' IDENTIFIED BY 'NEW'; -- global, no USE needed |
||
| 41 | FLUSH PRIVILEGES; |
||
| 42 | ``` |
||
| 43 | Dump / restore: |
||
| 44 | |||
| 45 | ``` |
||
| 46 | podman exec db-<name> sh -c 'mariadb-dump -uroot -p"$MYSQL_ROOT_PASSWORD" wordpress' > ~/tmp/<name>-$(date +%F).sql |
||
| 47 | podman exec -i db-<name> sh -c 'mariadb -uroot -p"$MYSQL_ROOT_PASSWORD" wordpress' < ~/tmp/<name>-YYYY-MM-DD.sql |
||
| 48 | ``` |
||
| 49 | |||
| 50 | Staging โ production migration = DB dump/restore + `wp-content` copy (incl. |
||
| 51 | |||
| 52 | `.htaccess`) + search-replace of the URL (`wp search-replace` via WP-CLI or |
||
| 53 | |||
| 54 | the Better Search Replace plugin). |
||
| 55 | |||
| 56 | --- |
||
| 57 | |||
| 58 | *Source: `dmz-web-podman-cheatsheet.md` v1.1.1 in the `dmz-web-deploy` repo ([Releases](#)). Edit the wiki and the repo copy together.* |