| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| servers:windows:nginx:wordpress [2025/06/11 12:04] – [Server Block] Sean Rhone | servers:windows:nginx:wordpress [2025/10/10 07:33] (current) – Sean Rhone |
|---|
| ===== Prerequisites ===== | ===== Prerequisites ===== |
| |
| * [[windows;10_ltsc_server|Windows 10 (21H2)]] | * [[windows;11_ltsc_server|Windows 11 (24H2)]] |
| * [[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)]] |
| ====== Database ====== | ====== Database ====== |
| |
| "%ProgramFiles%\MariaDB 12.0\bin\mariadb.exe" -u "root" -p | "%ProgramFiles%\MariaDB 12.1\bin\mariadb.exe" -u "root" -p |
| |
| CREATE DATABASE wordpress; | CREATE DATABASE wordpress; |
| extension = "openssl" | extension = "openssl" |
| extension = "sodium" | extension = "sodium" |
| zend_extension = "opcache" | |
| |
| ; Settings | ; Settings |
| |
| "%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> |
| | @echo off |
| | |
| | :: User\Downloads |
| | "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> |
| | |
| | "%SystemDrive%\www\scripts\media\Back-up.bat" |
| | |
| | ===== Maintenance ===== |
| | |
| | "notepad.exe" "%SystemDrive%\www\scripts\media\Maintenance.bat" |
| | |
| | <code> |
| | @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" fsck --full --strict |
| | |
| | PAUSE |
| | |
| | :: End</code> |
| | |
| | "%SystemDrive%\www\scripts\blog\Git Fix.bat" |
| |
| ====== Shortcuts ====== | ====== Shortcuts ====== |
| **** | **** |
| |
| CD "%USERPROFILE%\Downloads" && "%PROGRAMFILES%\MariaDB 12.0\bin\mariadb-dump.exe" -u "root" -p --opt -r "wordpress.sql" "wordpress" | CD "%USERPROFILE%\Downloads" && "%PROGRAMFILES%\MariaDB 12.1\bin\mariadb-dump.exe" -u "root" -p --opt -r "wordpress.sql" "wordpress" |
| |
| ===== Restore ===== | ===== Restore ===== |
| * [[#database|Initial set-up]] | * [[#database|Initial set-up]] |
| |
| "%ProgramFiles%\MariaDB 12.0\bin\mariadb.exe" -u "root" -p --execute="CREATE DATABASE wordpress" | "%ProgramFiles%\MariaDB 12.1\bin\mariadb.exe" -u "root" -p --execute="CREATE DATABASE wordpress" |
| |
| "%ProgramFiles%\MariaDB 12.0\bin\mariadb.exe" -u "root" -p "wordpress" < "%UserProfile%\Downloads\wordpress.sql" | "%ProgramFiles%\MariaDB 12.1\bin\mariadb.exe" -u "root" -p "wordpress" < "%UserProfile%\Downloads\wordpress.sql" |
| |
| ====== Quick Commands ====== | ====== Quick Commands ====== |