| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| servers:windows:nginx:wordpress [2026/01/20 11:10] – [Settings] Sean Rhone | servers:windows:nginx:wordpress [2026/04/15 10:05] (current) – [PHP-CGI] Sean Rhone |
|---|
| ====== Database ====== | ====== Database ====== |
| |
| "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" | "%ProgramFiles%\MariaDB 12.3\bin\mariadb.exe" -u "root" |
| |
| CREATE DATABASE wordpress; | CREATE DATABASE wordpress; |
| ===== PHP ===== | ===== PHP ===== |
| |
| "notepad.exe" "%SystemDrive%\www\php\blog.ini" | "%SystemRoot%\System32\notepad.exe" "%SystemDrive%\www\php\blog.ini" |
| |
| <code> | <code> |
| ===== PHP-CGI ===== | ===== PHP-CGI ===== |
| |
| "notepad.exe" "%SystemDrive%\www\nginx\default.d\blog.conf" | "%SystemRoot%\System32\notepad.exe" "%SystemDrive%\www\nginx\default.d\blog.conf" |
| |
| <code> | <code> |
| * Deny all except ''twentytwentyfive'' | * Deny all except ''twentytwentyfive'' |
| |
| "notepad.exe" "%SystemDrive%\www\nginx\default.d\wp-themes-deny.conf" | "%SystemRoot%\System32\notepad.exe" "%SystemDrive%\www\nginx\default.d\wp-themes-deny.conf" |
| |
| <code> | <code> |
| ===== Server Block ===== | ===== Server Block ===== |
| |
| "notepad.exe" "%SystemDrive%\www\nginx\vhosts.d\blog.conf" | "%SystemRoot%\System32\notepad.exe" "%SystemDrive%\www\nginx\vhosts.d\blog.conf" |
| |
| <code> | <code> |
| MKDIR "%SystemDrive%\www\scripts\blog" | MKDIR "%SystemDrive%\www\scripts\blog" |
| |
| "explorer.exe" "%SystemDrive%\www\scripts\blog" | "%SystemRoot%\explorer.exe" "%SystemDrive%\www\scripts\blog" |
| |
| ===== PHP-CGI ===== | ===== PHP-CGI ===== |
| |
| "notepad.exe" "%SystemDrive%\www\scripts\blog\PHP-CGI.bat" | "%SystemRoot%\System32\notepad.exe" "%SystemDrive%\www\scripts\blog\PHP-CGI.bat" |
| |
| <code> | <code> |
| 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 /D "%Temp%" "php-cgi.exe" -b "127.0.0.1:9004" -c "%SystemDrive%\www\php\blog.ini" -q |
| |
| SET "PHP_FCGI_MAX_REQUESTS=" | SET "PHP_FCGI_MAX_REQUESTS=" |
| ===== Update ===== | ===== Update ===== |
| |
| "notepad.exe" "%SystemDrive%\www\scripts\blog\Update.bat" | "%SystemRoot%\System32\notepad.exe" "%SystemDrive%\www\scripts\blog\Update.bat" |
| |
| <code> | <code> |
| ===== Back-up ===== | ===== Back-up ===== |
| |
| "notepad.exe" "%SystemDrive%\www\scripts\blog\Back-up.bat" | "%SystemRoot%\System32\notepad.exe" "%SystemDrive%\www\scripts\blog\Back-up.bat" |
| |
| <code> | <code> |
| CD "%Temp%" | CD "%Temp%" |
| |
| "tar.exe" -czf "D:\Servers\Scheduled Backups\wordpress-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "blog" | "%SystemRoot%\System32\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" | "%ProgramFiles%\MariaDB 12.3\bin\mariadb-dump.exe" -u "root" --opt --single-transaction -r "D:\Servers\Scheduled Backups\%RANDOM%-wordpress.sql" "wordpress" |
| |
| ::"tar.exe" -czf "%UserProfile%\Downloads\wordpress-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "blog" | ::"%SystemRoot%\System32\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.3\bin\mariadb-dump.exe" -u "root" --opt --single-transaction -r "%UserProfile%\Downloads\%RANDOM%-wordpress.sql" "wordpress" |
| |
| :: End</code> | :: End</code> |
| ===== Maintenance ===== | ===== Maintenance ===== |
| |
| "notepad.exe" "%SystemDrive%\www\scripts\blog\Maintenance.bat" | "%SystemRoot%\System32\notepad.exe" "%SystemDrive%\www\scripts\blog\Maintenance.bat" |
| |
| <code> | <code> |
| ===== Git Fix ===== | ===== Git Fix ===== |
| |
| * :!: Set email for ''user.email'' | * :!: Set ''user.email'' |
| |
| "notepad.exe" "%SystemDrive%\www\scripts\blog\Git Fix.bat" | "%SystemRoot%\System32\notepad.exe" "%SystemDrive%\www\scripts\blog\Git Fix.bat" |
| |
| <code> | <code> |
| * Auto-start | * Auto-start |
| |
| SCHTASKS /Create /SC "ONLOGON" /TN "Blog PHP-CGI" /TR "%SystemDrive%\www\scripts\blog\PHP-CGI.bat" /F | "%SystemRoot%\System32\schtasks.exe" /Create /SC "ONLOGON" /TN "Blog PHP-CGI" /TR "%SystemDrive%\www\scripts\blog\PHP-CGI.bat" /F |
| |
| ===== Update ===== | ===== Update ===== |
| * Daily ''02:00:00 AM'' | * Daily ''02:00:00 AM'' |
| |
| SCHTASKS /Create /SC "DAILY" /TN "Blog Update" /TR "%SystemDrive%\www\scripts\blog\Update.bat" /ST "02:00" /F | "%SystemRoot%\System32\schtasks.exe" /Create /SC "DAILY" /TN "Blog Update" /TR "%SystemDrive%\www\scripts\blog\Update.bat" /ST "02:00" /F |
| |
| ===== Back-up ===== | ===== Back-up ===== |
| * Monthly (3rd) ''02:10:00 AM'' | * Monthly (3rd) ''02:10:00 AM'' |
| |
| SCHTASKS /Create /SC "MONTHLY" /D "3" /M "*" /TN "Blog Back-up" /TR "%SystemDrive%\www\scripts\blog\Back-up.bat" /ST "02:10" /F | "%SystemRoot%\System32\schtasks.exe" /Create /SC "MONTHLY" /D "3" /M "*" /TN "Blog Back-up" /TR "%SystemDrive%\www\scripts\blog\Back-up.bat" /ST "02:10" /F |
| |
| ===== Maintenance ===== | ===== Maintenance ===== |
| * Monthly (3rd) ''02:30:00 AM'' | * Monthly (3rd) ''02:30:00 AM'' |
| |
| SCHTASKS /Create /SC "MONTHLY" /D "3" /M "*" /TN "Blog Maintenance" /TR "%SystemDrive%\www\scripts\blog\Maintenance.bat" /ST "02:30" /F | "%SystemRoot%\System32\schtasks.exe" /Create /SC "MONTHLY" /D "3" /M "*" /TN "Blog Maintenance" /TR "%SystemDrive%\www\scripts\blog\Maintenance.bat" /ST "02:30" /F |
| |
| ====== Initial Setup ====== | ====== Initial Setup ====== |
| * :!: Change ''DB_PASSWORD'' | * :!: Change ''DB_PASSWORD'' |
| |
| "notepad.exe" "%SystemDrive%\www\blog\wp-config.php" | "%SystemRoot%\System32\notepad.exe" "%SystemDrive%\www\blog\wp-config.php" |
| |
| <code> | <code> |
| **** | **** |
| |
| "tar.exe" -czf "%UserProfile%\Downloads\wordpress-files-manual-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "blog" | "%SystemRoot%\System32\tar.exe" -czf "%UserProfile%\Downloads\wordpress-files-manual-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "blog" |
| |
| ===== Database ===== | ===== Database ===== |
| **** | **** |
| |
| CD "%USERPROFILE%\Downloads" && "%PROGRAMFILES%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" --opt -r "wordpress.sql" "wordpress" | "%ProgramFiles%\MariaDB 12.3\bin\mariadb-dump.exe" -u "root" --opt --single-transaction -r "%UserProfile%\Downloads\wordpress.sql" "wordpress" |
| |
| ====== Restore ====== | ====== Restore ====== |
| * [[#database|Initial set-up]] | * [[#database|Initial set-up]] |
| |
| "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" --execute="CREATE DATABASE wordpress" | "%ProgramFiles%\MariaDB 12.3\bin\mariadb.exe" -u "root" --execute="CREATE DATABASE wordpress" |
| |
| "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" "wordpress" < "%UserProfile%\Downloads\wordpress.sql" | "%ProgramFiles%\MariaDB 12.3\bin\mariadb.exe" -u "root" "wordpress" < "%UserProfile%\Downloads\wordpress.sql" |
| |