User Tools

Site Tools


servers:windows:nginx:wordpress

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
servers:windows:nginx:wordpress [2025/11/29 00:43] – [Back-up] Sean Rhoneservers:windows:nginx:wordpress [2026/01/20 15:20] (current) – [Git Fix] Sean Rhone
Line 2: Line 2:
  
   * WordPress ((https://wordpress.org))   * WordPress ((https://wordpress.org))
-  * [[Information:Realm of Espionage]]+  * [[information;realm_of_espionage|Realm of Espionage]]
   * https://blog.realmofespionage.xyz   * https://blog.realmofespionage.xyz
  
 ===== Prerequisites ===== ===== Prerequisites =====
  
-  * [[windows;10|Windows 10 (21H2)]]+  * [[windows;10_ltsc_server|Windows 10 (21H2)]]
   * [[servers;windows;nginx_php_php-cgi|nginx + PHP + PHP-CGI]]   * [[servers;windows;nginx_php_php-cgi|nginx + PHP + PHP-CGI]]
   * [[servers;windows;nginx;lets_encrypt|Certbot (Let's Encrypt)]]   * [[servers;windows;nginx;lets_encrypt|Certbot (Let's Encrypt)]]
Line 26: Line 26:
 ====== Database ====== ====== Database ======
  
-  "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" -p+  "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root"
  
   CREATE DATABASE wordpress;   CREATE DATABASE wordpress;
Line 55: Line 55:
 extension = "sodium" extension = "sodium"
  
 +log_errors = "Off"
 error_reporting = "~E_ALL" error_reporting = "~E_ALL"
 display_errors = "Off" display_errors = "Off"
-log_errors = "Off"+display_startup_errors = "Off" 
 +html_errors = "Off"
  
 [Date] [Date]
Line 74: Line 76:
 <code> <code>
 location "~" "\.(php)(/.*)?$" { location "~" "\.(php)(/.*)?$" {
- 
  fastcgi_split_path_info "^(.+\.(?:php))(/.*)$";  fastcgi_split_path_info "^(.+\.(?:php))(/.*)$";
  fastcgi_intercept_errors "on";  fastcgi_intercept_errors "on";
Line 84: Line 85:
  
  fastcgi_pass "127.0.0.1:9004";  fastcgi_pass "127.0.0.1:9004";
-  
 } }
  
Line 93: Line 93:
   * https://github.com/WordPress/WordPress/tree/master/wp-content/themes   * https://github.com/WordPress/WordPress/tree/master/wp-content/themes
   * Deny all except ''twentytwentyfive''   * Deny all except ''twentytwentyfive''
-  * 2025/11/21: No ''twentytwentysix'' (2026) yet 
  
   "notepad.exe" "%SystemDrive%\www\nginx\default.d\wp-themes-deny.conf"   "notepad.exe" "%SystemDrive%\www\nginx\default.d\wp-themes-deny.conf"
Line 110: Line 109:
 <code> <code>
 server { server {
- 
  listen "443" "ssl";  listen "443" "ssl";
  http2 "on";  http2 "on";
Line 120: Line 118:
  include "C:/www/nginx/default.d/headers.conf";  include "C:/www/nginx/default.d/headers.conf";
  include "C:/www/nginx/default.d/wp-themes-deny.conf";  include "C:/www/nginx/default.d/wp-themes-deny.conf";
- 
- client_max_body_size "10M"; 
  
 # access_log "logs/blog-access.log"; # access_log "logs/blog-access.log";
Line 131: Line 127:
  
  rewrite "/wp-admin$" "$scheme://$host$uri/" "permanent";  rewrite "/wp-admin$" "$scheme://$host$uri/" "permanent";
- 
 } }
  
Line 149: Line 144:
  
 <code> <code>
 +@echo off
 +
 +CD "%Temp%"
 +
 SET "PHP_FCGI_MAX_REQUESTS=0" SET "PHP_FCGI_MAX_REQUESTS=0"
 SET "PHP_FCGI_CHILDREN=1" SET "PHP_FCGI_CHILDREN=1"
  
 START "Blog PHP-CGI" /MIN "php-cgi.exe" -b "127.0.0.1:9004" -c "%SystemDrive%\www\php\blog.ini" -q START "Blog PHP-CGI" /MIN "php-cgi.exe" -b "127.0.0.1:9004" -c "%SystemDrive%\www\php\blog.ini" -q
 +
 +SET "PHP_FCGI_MAX_REQUESTS="
 +SET "PHP_FCGI_CHILDREN="
  
 :: End</code> :: End</code>
Line 166: Line 168:
  
 TITLE Blog Updater TITLE Blog Updater
 +CD "%Temp%"
  
 "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" reset --hard "origin/master" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" reset --hard "origin/master"
Line 175: Line 178:
  
 ===== Back-up ===== ===== Back-up =====
- 
-  * ''D:\Servers\Scheduled Backups'' 
  
   "notepad.exe" "%SystemDrive%\www\scripts\blog\Back-up.bat"   "notepad.exe" "%SystemDrive%\www\scripts\blog\Back-up.bat"
Line 184: Line 185:
  
 TITLE Blog Back-up TITLE Blog Back-up
 +CD "%Temp%"
 +
 +"tar.exe" -czf "D:\Servers\Scheduled Backups\wordpress-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "blog"
 +"%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" --opt -r "D:\Servers\Scheduled Backups\%RANDOM%-wordpress.sql" "wordpress"
  
-:: User\Downloads 
 ::"tar.exe" -czf "%UserProfile%\Downloads\wordpress-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "blog" ::"tar.exe" -czf "%UserProfile%\Downloads\wordpress-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "blog"
 ::"%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" --opt -r "%UserProfile%\Downloads\%RANDOM%-wordpress.sql" "wordpress" ::"%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" --opt -r "%UserProfile%\Downloads\%RANDOM%-wordpress.sql" "wordpress"
- 
-:: NAS 
-"tar.exe" -czf "D:\Servers\Scheduled Backups\wordpress-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "blog" 
-"%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" --opt -r "D:\Servers\Scheduled Backups\%RANDOM%-wordpress.sql" "wordpress" 
  
 :: End</code> :: End</code>
Line 205: Line 205:
  
 TITLE Blog Maintenance TITLE Blog Maintenance
 +CD "%Temp%"
  
-MKDIR "%SystemDrive%\www\temp\blog" +"%ProgramFiles%\Git\bin\git.exe" -"%SystemDrive%\www\blog" gc --aggressive --prune="all
-MOVE /Y "%SystemDrive%\www\blog\wp-content\uploads" "%SystemDrive%\www\temp\blog" +"%ProgramFiles%\Git\bin\git.exe-C "%SystemDrive%\www\blog" fsck --full --strict
-COPY /Y "%SystemDrive%\www\blog\wp-config.php"%SystemDrive%\www\temp\blog+
- +
-CALL "%SystemDrive%\www\scripts\blog\Git Fix.bat" +
- +
-MOVE /Y "%SystemDrive%\www\temp\blog\uploads"%SystemDrive%\www\blog\wp-content" +
-MOVE /Y "%SystemDrive%\www\temp\blog\wp-config.php" "%SystemDrive%\www\blog\wp-config.php" +
-RMDIR /S /Q "%SystemDrive%\www\temp\blog"+
  
 :: End</code> :: End</code>
Line 222: Line 216:
 ===== Git Fix ===== ===== Git Fix =====
  
-  * :!: ''wp-content\uploads'' needs backed-up and restored (see [[#maintenance|Maintenance.bat]]) +  * :!: Set ''user.email''
-  * :!: [[#wp-configphp|wp-config.php]] needs re-applied afterwards +
- +
-  * :!: Set email for ''user.email''+
  
   "notepad.exe" "%SystemDrive%\www\scripts\blog\Git Fix.bat"   "notepad.exe" "%SystemDrive%\www\scripts\blog\Git Fix.bat"
Line 233: Line 224:
  
 TITLE Blog Git Fix TITLE Blog Git Fix
 +CD "%Temp%"
  
-RMDIR /S /Q "%SystemDrive%\www\blog\.git"+::################## 
 +::# Content Back-up 
 +::##################
  
 +MKDIR "%SystemDrive%\www\temp\blog"
 +MOVE /Y "%SystemDrive%\www\blog\wp-content\uploads" "%SystemDrive%\www\temp\blog"
 +COPY /Y "%SystemDrive%\www\blog\wp-config.php" "%SystemDrive%\www\temp\blog"
 +
 +::##################
 +::# WordPress
 +::##################
 +
 +RMDIR /S /Q "%SystemDrive%\www\blog\.git"
 "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" init --initial-branch="master" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" init --initial-branch="master"
 "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" add "." "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" add "."
 +
 +::######################################
 "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" config "user.email" "espionage724@x" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" config "user.email" "espionage724@x"
 +::######################################
 +
 "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" commit --message="x" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" commit --message="x"
  
 "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" remote add "origin" "https://github.com/WordPress/WordPress.git" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" remote add "origin" "https://github.com/WordPress/WordPress.git"
 "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" pull --depth "1" --recurse-submodules "origin" "master" --rebase "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" pull --depth "1" --recurse-submodules "origin" "master" --rebase
-"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" reset --hard "origin/master" 
  
 +"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" reset --hard "origin/master"
 "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" gc --aggressive --prune="all" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" gc --aggressive --prune="all"
 "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" fsck --full --strict "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" fsck --full --strict
 +
 +::##################
 +::# Content Restore
 +::##################
 +
 +MOVE /Y "%SystemDrive%\www\temp\blog\uploads" "%SystemDrive%\www\blog\wp-content"
 +MOVE /Y "%SystemDrive%\www\temp\blog\wp-config.php" "%SystemDrive%\www\blog\wp-config.php"
 +RMDIR /S /Q "%SystemDrive%\www\temp\blog"
  
 :: End</code> :: End</code>
Line 252: Line 267:
   "%SystemDrive%\www\scripts\blog\Git Fix.bat"   "%SystemDrive%\www\scripts\blog\Git Fix.bat"
  
-====== Shortcuts ======+====== Task Scheduler ======
  
-===== Autostart =====+===== PHP-CGI =====
  
-==== PHP-CGI ====+  * Auto-start
  
-  "explorer.exe" "%AppData%\Microsoft\Windows\Start Menu\Programs\StartUp" +  SCHTASKS /Create /SC "ONLOGON/TN "Blog PHP-CGI/TR "%SystemDrive%\www\scripts\blog\PHP-CGI.bat" /F
- +
-  "%SystemDrive%\www\scripts\blog\PHP-CGI.bat" +
- +
-  Blog PHP-CGI +
- +
-====== Task Scheduler ====== +
- +
-**** +
- +
-  taskschd.msc+
  
 ===== Update ===== ===== Update =====
  
-  * ''2:00:00 AM'' daily+  * Daily ''02:00:00 AM''
  
-  Blog Update +  SCHTASKS /Create /SC "DAILY" /TN "Blog Update" /TR "%SystemDrive%\www\scripts\blog\Update.bat" /ST "02:00" /F
- +
-  "%SystemDrive%\www\scripts\blog\Update.bat"+
  
 ===== Back-up ===== ===== Back-up =====
  
-  * Monthly -> All months -> Days: ''3'' +  * Monthly (3rd) ''02:10:00 AM''
-  * ''2:15:00 AM''+
  
-  Blog Back-up +  SCHTASKS /Create /SC "MONTHLY" /D "3" /M "*" /TN "Blog Back-up" /TR "%SystemDrive%\www\scripts\blog\Back-up.bat" /ST "02:10" /F
- +
-  "%SystemDrive%\www\scripts\blog\Back-up.bat"+
  
 ===== Maintenance ===== ===== Maintenance =====
  
-  * Monthly -> All months -> Days: ''3'' +  * Monthly (3rd) ''02:30:00 AM''
-  * ''2:30:00 AM''+
  
-  Blog Maintenance +  SCHTASKS /Create /SC "MONTHLY" /D "3" /M "*" /TN "Blog Maintenance" /TR "%SystemDrive%\www\scripts\blog\Maintenance.bat" /ST "02:30" /F
- +
-  "%SystemDrive%\www\scripts\blog\Maintenance.bat"+
  
 ====== Initial Setup ====== ====== Initial Setup ======
  
   * https://blog.realmofespionage.xyz   * https://blog.realmofespionage.xyz
 +  * Database Host: ''localhost''
  
 ====== Settings ====== ====== Settings ======
  
-  * https://developer.wordpress.org/advanced-administration/wordpress/update-services/#xml-rpc-ping-services+  * Date Format -> Custom''Y/m/d'' 
 +  * Permalink structure: ''[x]'' Plain
  
 ===== wp-config.php ===== ===== wp-config.php =====
Line 308: Line 307:
   * https://github.com/WordPress/WordPress/blob/master/wp-config-sample.php   * https://github.com/WordPress/WordPress/blob/master/wp-config-sample.php
   * https://developer.wordpress.org/advanced-administration/wordpress/wp-config/   * https://developer.wordpress.org/advanced-administration/wordpress/wp-config/
 +  * ''SCRIPT_DEBUG'' at ''true'' loads non-minified scripts/CSS ([[https://github.com/WordPress/WordPress/blob/master/wp-includes/script-loader.php#L6|source]]) ((2026/01/06: Fixed 2025 theme loading odd buttons in header))
  
   * :!: Change ''DB_PASSWORD''   * :!: Change ''DB_PASSWORD''
Line 326: Line 326:
 define( 'WP_DEBUG', false ); define( 'WP_DEBUG', false );
 define( 'WP_DEBUG_DISPLAY', false ); define( 'WP_DEBUG_DISPLAY', false );
 +
 +define( 'SCRIPT_DEBUG', true );
  
 if ( ! defined( 'ABSPATH' ) ) { if ( ! defined( 'ABSPATH' ) ) {
- define( 'ABSPATH', __DIR__ . '/' );+        define( 'ABSPATH', __DIR__ . '/' );
 } }
  
Line 335: Line 337:
 // End</code> // End</code>
  
-====== Files ======+====== Backup ======
  
-===== Backup =====+===== Folder =====
  
 **** ****
Line 343: Line 345:
   "tar.exe" -czf "%UserProfile%\Downloads\wordpress-files-manual-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "blog"   "tar.exe" -czf "%UserProfile%\Downloads\wordpress-files-manual-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "blog"
  
-====== Database ====== +===== Database =====
- +
-===== Backup =====+
  
 **** ****
  
-  CD "%USERPROFILE%\Downloads" && "%PROGRAMFILES%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" -p --opt -r "wordpress.sql" "wordpress"+  CD "%USERPROFILE%\Downloads" && "%PROGRAMFILES%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" --opt -r "wordpress.sql" "wordpress" 
 + 
 +====== Restore ======
  
-===== Restore =====+===== Database =====
  
   * [[#database|Initial set-up]]   * [[#database|Initial set-up]]
  
-  "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" -p --execute="CREATE DATABASE wordpress"+  "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" --execute="CREATE DATABASE wordpress"
  
-  "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" -p "wordpress" < "%UserProfile%\Downloads\wordpress.sql"+  "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" "wordpress" < "%UserProfile%\Downloads\wordpress.sql"
  
/usr/local/www/wiki/data/attic/servers/windows/nginx/wordpress.1764395011.txt.gz · Last modified: by Sean Rhone