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/01/17 15:13] Sean Rhoneservers:windows:nginx:wordpress [2025/10/10 07:33] (current) Sean Rhone
Line 7: Line 7:
 ===== Prerequisites ===== ===== Prerequisites =====
  
-  * [[windows;10|Windows 10]] +  * [[windows;11_ltsc_server|Windows 11 (24H2)]] 
-  * [[servers;windows;freenginx_php_php-cgi|freenginx + 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)]]
 +  * [[programs;windows;git|Git]]
 +  * [[servers;windows;mariadb|MariaDB]]
  
 ====== Dependencies ====== ====== Dependencies ======
Line 15: Line 17:
   * https://wordpress.org/about/requirements/   * https://wordpress.org/about/requirements/
   * https://make.wordpress.org/hosting/handbook/server-environment/#php-extensions   * https://make.wordpress.org/hosting/handbook/server-environment/#php-extensions
- 
-===== Git ===== 
- 
-  * https://www.git-scm.com/download/win 
-  * Last tested: ''Git-2.47.1.2-64-bit.exe'' 
- 
-  * Git from the command line and also from 3rd-party software 
- 
-===== MariaDB Server ===== 
- 
-  * https://mariadb.org/download/ 
-  * Last tested: ''mariadb-11.6.2-winx64.msi'' 
- 
-  * No Development components or Third party tools 
-  * Use UTF8 as default server's character set 
-  * [x] Enable Networking 
  
 ====== Download Source ====== ====== Download Source ======
Line 37: Line 23:
  
   "%ProgramFiles%\Git\bin\git.exe" clone --branch "master" --depth "1" --recurse-submodules "https://github.com/WordPress/WordPress.git" "%SystemDrive%\www\blog"   "%ProgramFiles%\Git\bin\git.exe" clone --branch "master" --depth "1" --recurse-submodules "https://github.com/WordPress/WordPress.git" "%SystemDrive%\www\blog"
- 
-  explorer "%SystemDrive%\www\blog" 
  
 ====== Database ====== ====== Database ======
  
-  "%ProgramFiles%\MariaDB 11.6\bin\mariadb.exe" -u "root" -p+  "%ProgramFiles%\MariaDB 12.1\bin\mariadb.exe" -u "root" -p
  
   CREATE DATABASE wordpress;   CREATE DATABASE wordpress;
Line 58: Line 42:
 ===== PHP ===== ===== PHP =====
  
-  notepad "%SystemDrive%\www\php\blog.ini"+  "notepad.exe" "%SystemDrive%\www\php\blog.ini"
  
 <code> <code>
Line 73: Line 57:
 extension = "openssl" extension = "openssl"
 extension = "sodium" extension = "sodium"
-zend_extension = "opcache" 
  
 ; Settings ; Settings
Line 84: Line 67:
 ; End</code> ; End</code>
  
-  CD "%SystemDrive%\" && "php.exe" -c "%SystemDrive%\www\php\blog.ini" -m+  "php.exe" -c "%SystemDrive%\www\php\blog.ini" -m
  
-====== freenginx + PHP-CGI Configuration ======+====== nginx + PHP-CGI Configuration ======
  
 ===== PHP-CGI ===== ===== PHP-CGI =====
  
-  * :!: ''fastcgi_params'' include hard-coded to freenginx version path +  "notepad.exe" "%SystemDrive%\www\nginx\default.d\blog.conf"
- +
-  notepad "%SystemDrive%\www\nginx\default.d\blog.conf"+
  
 <code> <code>
-# PHP-CGI 
 location ~ \.(php)(/.*)?$ { location ~ \.(php)(/.*)?$ {
     fastcgi_split_path_info ^(.+\.(?:php))(/.*)$;     fastcgi_split_path_info ^(.+\.(?:php))(/.*)$;
     fastcgi_intercept_errors "on";     fastcgi_intercept_errors "on";
     fastcgi_index "index.php";     fastcgi_index "index.php";
-    include "C:/freenginx-1.27.4/conf/fastcgi_params";+    include "C:/www/nginx/conf/fastcgi_params";
     fastcgi_param "SCRIPT_FILENAME" $document_root$fastcgi_script_name;     fastcgi_param "SCRIPT_FILENAME" $document_root$fastcgi_script_name;
     fastcgi_param "PATH_INFO" $fastcgi_path_info;     fastcgi_param "PATH_INFO" $fastcgi_path_info;
     fastcgi_param "HTTPS" "on";     fastcgi_param "HTTPS" "on";
     fastcgi_pass "127.0.0.1:9004";     fastcgi_pass "127.0.0.1:9004";
-}</code>+} 
 + 
 +# End</code> 
 + 
 +===== Themes Deny ===== 
 + 
 +  * https://github.com/WordPress/WordPress/tree/master/wp-content/themes 
 +  * Deny all except ''twentytwentyfive'' 
 + 
 +  "notepad.exe" "%SystemDrive%\www\nginx\default.d\wp-themes-deny.conf" 
 + 
 +<code> 
 +location ~ /wp-content/themes/(twentyeleven|twentyfifteen|twentyfourteen|twentynineteen|twentyseventeen|twentysixteen|twentyten|twentythirteen|twentytwelve|twentytwentyfour|twentytwentyone|twentytwentythree|twentytwentytwo|twentytwenty)/
 +    deny all; 
 +
 + 
 +# End</code>
  
 ===== Server Block ===== ===== Server Block =====
  
-  notepad "%SystemDrive%\www\nginx\vhosts.d\blog.conf"+  "notepad.exe" "%SystemDrive%\www\nginx\vhosts.d\blog.conf"
  
 <code> <code>
Line 121: Line 117:
     include C:/www/nginx/default.d/blog.conf;     include C:/www/nginx/default.d/blog.conf;
     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;
  
     client_max_body_size "10M";     client_max_body_size "10M";
Line 135: Line 132:
     rewrite /wp-admin$ $scheme://$host$uri/ permanent;     rewrite /wp-admin$ $scheme://$host$uri/ permanent;
  
-    location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ { +}
-          access_log off; log_not_found off; expires max; +
-    } +
-}</code>+
  
-  "%SystemDrive%\www\scripts\freenginx\Reload.bat"+# End</code>
  
-====== Batch Files ======+  "%SystemDrive%\www\scripts\nginx\Reload.bat"
  
-  MKDIR "%SystemDrive%\www\scripts\blog"+====== Scripts ======
  
-  explorer "%SystemDrive%\www\scripts\blog"+**** 
 + 
 +  MKDIR "%SystemDrive%\www\scripts\blog"
  
 ===== PHP-CGI ===== ===== PHP-CGI =====
  
-  notepad "%SystemDrive%\www\scripts\blog\PHP-CGI.bat"+  "notepad.exe" "%SystemDrive%\www\scripts\blog\PHP-CGI.bat"
  
 <code> <code>
Line 162: Line 158:
   "%SystemDrive%\www\scripts\blog\PHP-CGI.bat"   "%SystemDrive%\www\scripts\blog\PHP-CGI.bat"
  
-==== Autostart ====+===== Update =====
  
-  explorer "%ProgramData%\Microsoft\Windows\Start Menu\Programs\StartUp"+  "notepad.exe" "%SystemDrive%\www\scripts\blog\Update.bat"
  
-  "%SystemDrive%\www\scripts\blog\PHP-CGI.bat"+<code> 
 +@echo off
  
-  Blog PHP-CGI+"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" reset --hard 
 +"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blog" pull origin "master" --rebase
  
-===== Update =====+"%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
  
-  * https://github.com/WordPress/WordPress/commits/master/+:: End</code>
  
-  notepad "%SystemDrive%\www\scripts\blog\Update.bat"+  "%SystemDrive%\www\scripts\blog\Update.bat" 
 + 
 +===== Back-up ===== 
 + 
 +  * TODO 
 + 
 +  "notepad.exe" "%SystemDrive%\www\scripts\media\Back-up.bat"
  
 <code> <code>
 @echo off @echo off
  
-"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blogreset --hard +:: User\Downloads 
-"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\blogpull origin "master--rebase+"tar.exe" -czf "%UserProfile%\Downloads\dokuwiki-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www\wiki"data/pages" "data/meta" "data/media" "data/media_meta" "data/attic" "data/media_attic" "conf" 
 + 
 +:: NAS 
 +::"tar.exe" -czf "D:\Servers\Scheduled Backups\dokuwiki-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www\wiki" "data/pages" "data/meta" "data/media" "data/media_meta" "data/attic" "data/media_attic" "conf"
  
 :: End</code> :: End</code>
 +
 +  "%SystemDrive%\www\scripts\media\Back-up.bat"
  
 ===== Maintenance ===== ===== Maintenance =====
  
-  notepad "%SystemDrive%\www\scripts\blog\Maintenance.bat"+  "notepad.exe" "%SystemDrive%\www\scripts\media\Maintenance.bat"
  
 <code> <code>
 @echo off @echo off
 +
 +:: Piwigo
 +"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" reset --hard
 +
 +"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" gc --aggressive --prune="all"
 +"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" fsck --full --strict
 +
 +:: Bootstrap Darkroom
 +"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" reset --hard
 +
 +"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" gc --aggressive --prune="all"
 +"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" fsck --full --strict
 +
 +:: End</code>
 +
 +  "%SystemDrive%\www\scripts\media\Maintenance.bat"
 +
 +===== Git Fix =====
 +
 +  * :!: Set email for ''user.email''
 +
 +  "notepad.exe" "%SystemDrive%\www\scripts\blog\Git Fix.bat"
 +
 +<code>
 +@echo off
 +
 +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" add "."
 +"%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" 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" 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
 +
 +PAUSE
  
 :: End</code> :: End</code>
 +
 +  "%SystemDrive%\www\scripts\blog\Git Fix.bat"
 +
 +====== Shortcuts ======
 +
 +===== Desktop =====
 +
 +==== Update ====
 +
 +  "%SystemDrive%\www\scripts\blog\Update.bat"
 +
 +  Blog Update
 +
 +===== Autostart =====
 +
 +==== CGI ====
 +
 +  "explorer.exe" "%AppData%\Microsoft\Windows\Start Menu\Programs\StartUp"
 +
 +  "%SystemDrive%\www\scripts\blog\PHP-CGI.bat"
 +
 +  Blog PHP-CGI
 +
 +====== Task Scheduler ======
 +
 +****
 +
 +  taskschd.msc
 +
 +===== Update =====
 +
 +  * ''01:30:00 AM'' daily
 +
 +  Blog Update
 +
 +  "%SystemDrive%\www\scripts\blog\Update.bat"
  
 ====== Initial Setup ====== ====== Initial Setup ======
Line 208: Line 292:
   * Add around line 90 ((convenient ''Add any custom values between this line and the "stop editing" line.''))   * Add around line 90 ((convenient ''Add any custom values between this line and the "stop editing" line.''))
  
-  notepad "%SystemDrive%\www\blog\wp-config.php"+  "notepad.exe" "%SystemDrive%\www\blog\wp-config.php"
  
 <code>define( 'WP_AUTO_UPDATE_CORE', false );</code> <code>define( 'WP_AUTO_UPDATE_CORE', false );</code>
 +
 +====== Files ======
 +
 +===== Backup =====
 +
 +****
 +
 +  "tar.exe" -czf "%UserProfile%\Downloads\wordpress-files-manual-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "blog"
 +
 +====== Database ======
 +
 +===== Backup =====
 +
 +****
 +
 +  CD "%USERPROFILE%\Downloads" && "%PROGRAMFILES%\MariaDB 12.1\bin\mariadb-dump.exe" -u "root" -p --opt -r "wordpress.sql" "wordpress"
 +
 +===== Restore =====
 +
 +  * [[#database|Initial set-up]]
 +
 +  "%ProgramFiles%\MariaDB 12.1\bin\mariadb.exe" -u "root" -p --execute="CREATE DATABASE wordpress"
 +
 +  "%ProgramFiles%\MariaDB 12.1\bin\mariadb.exe" -u "root" -p "wordpress" < "%UserProfile%\Downloads\wordpress.sql"
 +
 +====== Quick Commands ======
 +
 +===== Scripts =====
 +
 +****
 +
 +  "explorer.exe" "%SystemDrive%\www\scripts\blog"
 +
 +===== Bookmarks =====
 +
 +  * https://github.com/WordPress/WordPress/commits/master/
  
/srv/www/wiki/data/attic/servers/windows/nginx/wordpress.1737144780.txt.gz · Last modified: by Sean Rhone