servers:bsd:nginx:wordpress
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
servers:bsd:nginx:wordpress [2025/05/16 21:39] – external edit 127.0.0.1 | servers:bsd:nginx:wordpress [2025/08/28 00:46] (current) – [Server Block] Sean Rhone | ||
---|---|---|---|
Line 7: | Line 7: | ||
===== Prerequisites ===== | ===== Prerequisites ===== | ||
- | * [[bsd: | + | * [[bsd: |
- | * [[servers: | + | |
* [[servers: | * [[servers: | ||
* [[servers: | * [[servers: | ||
+ | * [[servers: | ||
====== Dependencies ====== | ====== Dependencies ====== | ||
Line 22: | Line 22: | ||
====== Download Source ====== | ====== Download Source ====== | ||
+ | |||
+ | * https:// | ||
su - | su - | ||
- | git clone --branch ' | + | git clone --branch ' |
====== Database ====== | ====== Database ====== | ||
Line 47: | Line 49: | ||
su - | su - | ||
- | ee '/ | + | ee '/ |
< | < | ||
Line 77: | Line 79: | ||
< | < | ||
- | # PHP-FPM | ||
location ~ \.(php|phar)(/ | location ~ \.(php|phar)(/ | ||
fastcgi_split_path_info ^(.+\.(?: | fastcgi_split_path_info ^(.+\.(?: | ||
Line 95: | Line 96: | ||
su - | su - | ||
- | ee '/ | + | ee '/ |
< | < | ||
server { | server { | ||
listen 443 ssl; | listen 443 ssl; | ||
- | # | + | |
server_name ' | server_name ' | ||
root '/ | root '/ | ||
Line 140: | Line 141: | ||
* https:// | * https:// | ||
* '' | * '' | ||
+ | * :?: May need or be fixed with '' | ||
su - | su - | ||
Line 159: | Line 161: | ||
su -m ' | su -m ' | ||
- | ===== Etc ===== | + | ===== Maintenance |
su - | su - | ||
Line 171: | Line 173: | ||
su -m ' | su -m ' | ||
- | | + | mariadb-check -u 'root' -p -o -f -e --auto-repair |
- | + | ||
- | su -m ' | + | |
- | + | ||
- | ====== Services ====== | + | |
- | + | ||
- | ===== Updater ===== | + | |
- | + | ||
- | ==== Service ==== | + | |
- | + | ||
- | sudo -e '/ | + | |
- | + | ||
- | < | + | |
- | [Service] | + | |
- | User=nginx | + | |
- | Group=nginx | + | |
- | Type=oneshot | + | |
- | ExecStart='/ | + | |
- | ExecStartPost='/ | + | |
- | + | ||
- | ==== Timer ==== | + | |
- | + | ||
- | * Every day at '' | + | |
- | + | ||
- | sudo -e '/ | + | |
- | + | ||
- | < | + | |
- | [Unit] | + | |
- | Description=WordPress Git Updater | + | |
- | After=network-online.target | + | |
- | Wants=network-online.target | + | |
- | + | ||
- | [Timer] | + | |
- | OnCalendar=*-*-* 04:00:00 | + | |
- | Persistent=true | + | |
- | + | ||
- | [Install] | + | |
- | WantedBy=timers.target</ | + | |
- | + | ||
- | ===== Maintenance ===== | + | |
- | + | ||
- | ==== Service ==== | + | |
- | + | ||
- | sudo -e '/ | + | |
- | + | ||
- | < | + | |
- | [Service] | + | |
- | User=nginx | + | |
- | Group=nginx | + | |
- | Type=oneshot | + | |
- | ExecStart='/ | + | |
- | ExecStart='/ | + | |
- | ExecStartPost='/ | + | |
- | + | ||
- | ==== Timer ==== | + | |
- | + | ||
- | * '' | + | |
- | + | ||
- | sudo -e '/ | + | |
- | + | ||
- | < | + | |
- | [Unit] | + | |
- | Description=WordPress Maintenance | + | |
- | After=network-online.target | + | |
- | Wants=network-online.target | + | |
- | + | ||
- | [Timer] | + | |
- | OnCalendar=*-*-01 04:20:00 | + | |
- | Persistent=true | + | |
- | + | ||
- | [Install] | + | |
- | WantedBy=timers.target</ | + | |
- | + | ||
- | ===== Backup ===== | + | |
- | + | ||
- | ==== Files ==== | + | |
- | + | ||
- | === Service === | + | |
- | + | ||
- | mkdir -p ~/' | + | |
- | + | ||
- | < | + | |
- | [Service] | + | |
- | Type=oneshot | + | |
- | WorkingDirectory=/ | + | |
- | ExecStart='/ | + | |
- | ExecStartPost='/ | + | |
- | + | ||
- | === Timer === | + | |
- | + | ||
- | * '' | + | |
- | + | ||
- | sudo -e '/ | + | |
- | + | ||
- | < | + | |
- | [Unit] | + | |
- | Description=WordPress Files Backup | + | |
- | + | ||
- | [Timer] | + | |
- | OnCalendar=*-*-01 04:35:00 | + | |
- | Persistent=true | + | |
- | + | ||
- | [Install] | + | |
- | WantedBy=timers.target</ | + | |
- | + | ||
- | ==== Database ==== | + | |
- | + | ||
- | === Database Auth === | + | |
- | + | ||
- | sudo mkdir -p '/ | + | |
- | + | ||
- | < | + | |
- | [mariadb-dump] | + | |
- | user=wordpress | + | |
- | password=x</ | + | |
- | + | ||
- | === Service === | + | |
- | + | ||
- | mkdir -p ~/'backups' | + | |
- | + | ||
- | < | + | |
- | [Service] | + | |
- | Type=oneshot | + | |
- | WorkingDirectory=/ | + | |
- | ExecStartPre='/ | + | |
- | ExecStart='/ | + | |
- | ExecStart='/ | + | |
- | ExecStartPost='/ | + | |
- | + | ||
- | === Timer === | + | |
- | + | ||
- | * Every day at '' | + | |
- | + | ||
- | sudo -e '/ | + | |
- | + | ||
- | < | + | |
- | [Unit] | + | |
- | Description=WordPress Database Backup | + | |
- | After=mariadb.service | + | |
- | + | ||
- | [Timer] | + | |
- | OnCalendar=*-*-* 04:45:00 | + | |
- | Persistent=true | + | |
- | + | ||
- | [Install] | + | |
- | WantedBy=timers.target</ | + | |
====== Backup ====== | ====== Backup ====== | ||
- | * Create backup archive on server and transfer to client computer | + | ===== Folder ===== |
- | ===== Server ===== | + | su - |
- | ==== Stop Services ==== | + | tar -czf '/ |
- | **** | + | ===== Database ===== |
- | + | ||
- | sudo systemctl stop nginx php-fpm | + | |
- | + | ||
- | ==== Backup Folder | + | |
**** | **** | ||
- | | + | |
- | ==== Backup Database | + | ===== scp ===== |
**** | **** | ||
- | | + | scp espionage724@192.168.1.152: |
- | + | ||
- | ==== Start Services ==== | + | |
- | + | ||
- | **** | + | |
- | + | ||
- | sudo systemctl start nginx php-fpm | + | |
- | + | ||
- | ===== Client ===== | + | |
- | + | ||
- | ==== Transfer Files To Client ==== | + | |
- | + | ||
- | **** | + | |
- | + | ||
- | | + | |
====== Restore ====== | ====== Restore ====== | ||
- | ===== Client | + | ===== scp ===== |
- | + | ||
- | ==== Uncompress Database ==== | + | |
- | + | ||
- | * This is only needed if restoring an **automated** database backup ((manual doesn' | + | |
- | + | ||
- | gunzip ~/' | + | |
- | + | ||
- | ==== Transfer Files To Server | + | |
**** | **** | ||
- | scp ~/' | + | scp ~/' |
- | ==== Remove Files ==== | + | ===== Folder |
- | + | ||
- | **** | + | |
- | + | ||
- | rm -f ~/' | + | |
- | + | ||
- | ===== Server ===== | + | |
- | + | ||
- | ==== Stop Services ==== | + | |
- | + | ||
- | **** | + | |
- | + | ||
- | sudo systemctl stop nginx php-fpm | + | |
- | + | ||
- | ====== Restore ====== | + | |
- | + | ||
- | ===== Files ===== | + | |
su - | su - | ||
Line 394: | Line 209: | ||
rm -Rf '/ | rm -Rf '/ | ||
- | | + | tar -xzf '/ |
===== Database ===== | ===== Database ===== | ||
Line 402: | Line 217: | ||
mariadb -u ' | mariadb -u ' | ||
- | mariadb -u ' | + | mariadb -u ' |
+ | |||
+ | mariadb -u ' | ||
/usr/local/www/wiki/data/attic/servers/bsd/nginx/wordpress.1747445948.txt.gz · Last modified: by 127.0.0.1