| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| servers:bsd:nginx:wordpress [2026/07/07 09:15] – [Server Block] Sean Rhone | servers:bsd:nginx:wordpress [2026/07/24 02:13] (current) – [Backup] Sean Rhone |
|---|
| ===== Prerequisites ===== | ===== Prerequisites ===== |
| |
| * [[bsd:server:arm:freebsd_16.0|FreeBSD 16.0]] | * [[bsd:server:arm:freebsd_15.1|FreeBSD 15.1]] |
| * [[servers:bsd:freenginx_php_php-fpm|freenginx + PHP + PHP-FPM]] | * [[servers:bsd:freenginx_php_php-fpm|freenginx + PHP + PHP-FPM]] |
| * [[servers:bsd:nginx:lets_encrypt|Certbot (Let's Encrypt)]] | * [[servers:bsd:nginx:lets_encrypt|Certbot (Let's Encrypt)]] |
| |
| ; Logging | ; Logging |
| php_value[log_errors] = "Off" | php_value[log_errors] = "0" |
| php_value[error_reporting] = "~E_ALL" | php_value[error_reporting] = "~E_ALL" |
| php_value[display_errors] = "Off" | php_value[display_errors] = "0" |
| php_value[display_startup_errors] = "Off" | php_value[display_startup_errors] = "0" |
| php_value[html_errors] = "Off" | php_value[html_errors] = "0" |
| |
| ; General | ; General |
| # End</code> | # End</code> |
| |
| ===== Themes Deny ===== | ===== Deny Directive ===== |
| |
| * https://github.com/WordPress/WordPress/tree/master/wp-content/themes | * https://github.com/WordPress/WordPress/tree/master/wp-content/themes |
| * Deny all except ''twentytwentyfive'' | * Blocks themes except ''twentytwentyfive'' |
| |
| su - | su - |
| |
| ee '/usr/local/etc/freenginx/default.d/wp-themes-deny.conf' | ee '/usr/local/etc/freenginx/default.d/wordpress-deny.conf' |
| |
| <code> | <code> |
| | # Themes Block |
| location '~' '/wp-content/themes/(twentyeleven|twentyfifteen|twentyfourteen|twentynineteen|twentyseventeen|twentysixteen|twentyten|twentythirteen|twentytwelve|twentytwentyfour|twentytwentyone|twentytwentythree|twentytwentytwo|twentytwenty)/' { | location '~' '/wp-content/themes/(twentyeleven|twentyfifteen|twentyfourteen|twentynineteen|twentyseventeen|twentysixteen|twentyten|twentythirteen|twentytwelve|twentytwentyfour|twentytwentyone|twentytwentythree|twentytwentytwo|twentytwenty)/' { |
| deny 'all'; | deny 'all'; |
| include '/usr/local/etc/freenginx/default.d/headers.conf'; | include '/usr/local/etc/freenginx/default.d/headers.conf'; |
| |
| include '/usr/local/etc/freenginx/default.d/wp-themes-deny.conf'; | include '/usr/local/etc/freenginx/default.d/wordpress-deny.conf'; |
| |
| # access_log '/var/log/nginx/blog-access.log'; | # access_log '/var/log/nginx/blog-access.log'; |
| |
| ===== Backup ===== | ===== Backup ===== |
| | |
| | * [[bsd:notes:ufs_format|UFS NAS]] |
| |
| mkdir -p ~/'backups' ~/'.local/scripts/www/blog' && ee ~/'.local/scripts/www/blog/backup.sh' && chmod +x ~/'.local/scripts/www/blog/backup.sh' | mkdir -p ~/'backups' ~/'.local/scripts/www/blog' && ee ~/'.local/scripts/www/blog/backup.sh' && chmod +x ~/'.local/scripts/www/blog/backup.sh' |
| cd '/tmp' | cd '/tmp' |
| |
| '/usr/bin/tar' -czf '/home/espionage724/backups/wordpress-files-auto-'$(date +%Y-%m-%d)'.tar.gz' -C '/usr/local/www' 'blog' | '/usr/bin/tar' -czf '/mnt/NAS1/Servers/Scheduled Backups/wordpress-files-auto-'$(date +%Y-%m-%d)'.tar.gz' -C '/usr/local/www' 'blog' |
| | '/usr/local/bin/mariadb-dump' --single-transaction --quick 'wordpress' -r '/mnt/NAS1/Servers/Scheduled Backups/wordpress-database-auto-'$(date +%Y-%m-%d)'.sql' |
| |
| '/usr/local/bin/mariadb-dump' --single-transaction --quick 'wordpress' -r '/home/espionage724/backups/wordpress-database-auto-'$(date +%Y-%m-%d)'.sql' | #'/usr/bin/tar' -czf '/home/espionage724/backups/wordpress-files-auto-'$(date +%Y-%m-%d)'.tar.gz' -C '/usr/local/www' 'blog' |
| | #'/usr/local/bin/mariadb-dump' --single-transaction --quick 'wordpress' -r '/home/espionage724/backups/wordpress-database-auto-'$(date +%Y-%m-%d)'.sql' |
| |
| '/bin/sync' | '/bin/sync' |
| |
| ===== scp ===== | ===== scp ===== |
| |
| **** | |
| |
| scp espionage724@192.168.1.152:~/'wordpress-files-'*'.tar.gz' espionage724@192.168.1.152:~/'wordpress-database-'*'.sql' ~/'Downloads' | scp espionage724@192.168.1.152:~/'wordpress-files-'*'.tar.gz' espionage724@192.168.1.152:~/'wordpress-database-'*'.sql' ~/'Downloads' |
| |
| ===== scp ===== | ===== scp ===== |
| |
| **** | |
| |
| scp ~/'Downloads/wordpress-files-'*'.tar.gz' ~/'Downloads/wordpress'*'.sql' espionage724@192.168.1.152:~ | scp ~/'Downloads/wordpress-files-'*'.tar.gz' ~/'Downloads/wordpress'*'.sql' espionage724@192.168.1.152:~ |