| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| servers:windows:nginx:piwigo [2025/01/26 18:18] – Sean Rhone | servers:windows:nginx:piwigo [2025/10/10 07:33] (current) – Sean Rhone |
|---|
| ===== 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 ====== |
| |
| * https://piwigo.org/guides/install/requirements | * https://piwigo.org/guides/install/requirements |
| | * https://github.com/Piwigo/piwigo-videojs/wiki/How-to-add-videos |
| ===== Git ===== | * https://github.com/Piwigo/piwigo-videojs/wiki/Synchronize#requirement |
| | |
| * 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 ====== |
| |
| "%ProgramFiles%\Git\bin\git.exe" clone --branch "master" --depth "1" --recurse-submodules "https://github.com/Piwigo/Piwigo.git" "%SystemDrive%\www\media" | "%ProgramFiles%\Git\bin\git.exe" clone --branch "master" --depth "1" --recurse-submodules "https://github.com/Piwigo/Piwigo.git" "%SystemDrive%\www\media" |
| |
| explorer "%SystemDrive%\www\media" | |
| |
| ===== Bootstrap Darkroom ===== | ===== Bootstrap Darkroom ===== |
| ====== Database ====== | ====== Database ====== |
| |
| "%ProgramFiles%\MariaDB 11.6\bin\mariadb.exe" -u "root" -p | "%ProgramFiles%\MariaDB 12.1\bin\mariadb.exe" -u "root" -p |
| |
| CREATE DATABASE piwigo; | CREATE DATABASE piwigo; |
| ===== PHP ===== | ===== PHP ===== |
| |
| notepad "%SystemDrive%\www\php\media.ini" | "notepad.exe" "%SystemDrive%\www\php\media.ini" |
| |
| <code> | <code> |
| extension = "mbstring" | extension = "mbstring" |
| extension = "mysqli" | extension = "mysqli" |
| zend_extension = "opcache" | |
| |
| ; Settings | ; Settings |
| ; End</code> | ; End</code> |
| |
| CD "%SystemDrive%\" && "php.exe" -c "%SystemDrive%\www\php\media.ini" -m | "php.exe" -c "%SystemDrive%\www\php\media.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\media.conf" |
| | |
| notepad "%SystemDrive%\www\nginx\default.d\media.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; |
| ===== Server Block ===== | ===== Server Block ===== |
| |
| notepad "%SystemDrive%\www\nginx\vhosts.d\media.conf" | "notepad.exe" "%SystemDrive%\www\nginx\vhosts.d\media.conf" |
| |
| <code> | <code> |
| # access_log logs/media-access.log; | # access_log logs/media-access.log; |
| # error_log logs/media-error.log; | # error_log logs/media-error.log; |
| |
| # Install dir post-install block | |
| # | |
| # location "/install" { | |
| # location ~* \.(php)$ { | |
| # deny "all"; | |
| # } | |
| # } | |
| |
| location / { | location / { |
| # End</code> | # End</code> |
| |
| "%SystemDrive%\www\scripts\freenginx\Reload.bat" | "%SystemDrive%\www\scripts\nginx\Reload.bat" |
| |
| ====== Batch Files ====== | ====== Scripts ====== |
| | |
| | ===== Folder ===== |
| |
| MKDIR "%SystemDrive%\www\scripts\media" | MKDIR "%SystemDrive%\www\scripts\media" |
| |
| explorer "%SystemDrive%\www\scripts\media" | "explorer.exe" "%SystemDrive%\www\scripts\media" |
| |
| ===== PHP-CGI ===== | ===== PHP-CGI ===== |
| |
| notepad "%SystemDrive%\www\scripts\media\PHP-CGI.bat" | "notepad.exe" "%SystemDrive%\www\scripts\media\PHP-CGI.bat" |
| |
| <code> | <code> |
| | @echo off |
| | |
| SET "PHP_FCGI_MAX_REQUESTS=0" | SET "PHP_FCGI_MAX_REQUESTS=0" |
| SET "PHP_FCGI_CHILDREN=1" | SET "PHP_FCGI_CHILDREN=1" |
| "%SystemDrive%\www\scripts\media\PHP-CGI.bat" | "%SystemDrive%\www\scripts\media\PHP-CGI.bat" |
| |
| ==== Autostart ==== | ===== Update ===== |
| |
| explorer "%ProgramData%\Microsoft\Windows\Start Menu\Programs\StartUp" | "notepad.exe" "%SystemDrive%\www\scripts\media\Update.bat" |
| |
| "%SystemDrive%\www\scripts\media\PHP-CGI.bat" | <code> |
| | @echo off |
| |
| Media PHP-CGI | :: Piwigo |
| | "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" pull origin "master" |
| |
| ===== Update ===== | :: Bootstrap Darkroom |
| | "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" pull origin "master" |
| |
| * https://github.com/Piwigo/Piwigo/commits/master/ | :: End</code> |
| * https://github.com/Piwigo/piwigo-bootstrap-darkroom/commits/master/ | |
| |
| notepad "%SystemDrive%\www\scripts\media\Update.bat" | "%SystemDrive%\www\scripts\media\Update.bat" |
| | |
| | ===== Back-up ===== |
| | |
| | * TODO |
| | |
| | "notepad.exe" "%SystemDrive%\www\scripts\media\Back-up.bat" |
| |
| <code> | <code> |
| @echo off | @echo off |
| |
| :: Piwigo | :: User\Downloads |
| "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" reset --hard | "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" |
| "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" pull origin "master" --rebase | |
| |
| :: Bootstrap Darkroom | :: NAS |
| "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" reset --hard | ::"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" |
| "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" pull origin "master" --rebase | |
| |
| :: End</code> | :: End</code> |
| | |
| | "%SystemDrive%\www\scripts\media\Back-up.bat" |
| |
| ===== Maintenance ===== | ===== Maintenance ===== |
| |
| notepad "%SystemDrive%\www\scripts\media\Maintenance.bat" | "notepad.exe" "%SystemDrive%\www\scripts\media\Maintenance.bat" |
| |
| <code> | <code> |
| |
| :: Piwigo | :: 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" gc --aggressive --prune="all" |
| "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" fsck --full --strict | "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" fsck --full --strict |
| |
| :: Bootstrap Darkroom | :: 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" gc --aggressive --prune="all" |
| "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" fsck --full --strict | "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" fsck --full --strict |
| :: End</code> | :: End</code> |
| |
| ===== Back-up ===== | "%SystemDrive%\www\scripts\media\Maintenance.bat" |
| | |
| | ===== Git Fix ===== |
| |
| ==== Database ==== | * :!: Set email for both ''user.email'' |
| |
| notepad "%SystemDrive%\www\scripts\media\Database Back-up.bat" | "notepad.exe" "%SystemDrive%\www\scripts\media\Git Fix.bat" |
| |
| <code> | <code> |
| @echo off | @echo off |
| |
| :: User\Downloads | :: Piwigo |
| CD "%UserProfile%\Downloads" | RMDIR /S /Q "%SystemDrive%\www\media\.git" |
| |
| :: NAS | "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" init --initial-branch="master" |
| ::CD /D "D:\Servers\Scheduled Backups" | "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" add "." |
| | "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" config "user.email" "espionage724@x" |
| | "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" commit --message="x" |
| |
| echo Root MariaDB user password prompt: | "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" remote add "origin" "https://github.com/Piwigo/Piwigo.git" |
| "%ProgramFiles%\MariaDB 11.6\bin\mariadb-dump.exe" -u "root" -p --opt -r "piwigo-database-%RANDOM%.sql" "piwigo" | "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" pull --depth "1" --recurse-submodules "origin" "master" --rebase |
| | "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" reset --hard "origin/master" |
| |
| pause | "%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 |
| | RMDIR /S /Q "%SystemDrive%\www\media\themes\bootstrap_darkroom\.git" |
| | |
| | "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" init --initial-branch="master" |
| | "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" add "." |
| | "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" config "user.email" "espionage724@x" |
| | "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" commit --message="x" |
| | |
| | "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" remote add "origin" "https://github.com/Piwigo/piwigo-bootstrap-darkroom.git" |
| | "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" pull --depth "1" --recurse-submodules "origin" "master" --rebase |
| | "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" reset --hard "origin/master" |
| | |
| | "%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 |
| | |
| | PAUSE |
| |
| :: End</code> | :: End</code> |
| |
| ==== Files ==== | "%SystemDrive%\www\scripts\media\Git Fix.bat" |
| |
| notepad "%SystemDrive%\www\scripts\media\Files Back-up.bat" | ====== Shortcuts ====== |
| |
| <code> | ===== Autostart ===== |
| @echo off | |
| |
| :: User\Downloads | ==== CGI ==== |
| tar -czf "%UserProfile%\Downloads\piwigo-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "media" | |
| |
| :: NAS | "explorer.exe" "%AppData%\Microsoft\Windows\Start Menu\Programs\StartUp" |
| ::tar -czf "D:\Servers\Scheduled Backups\piwigo-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "media" | |
| |
| :: End</code> | "%SystemDrive%\www\scripts\media\PHP-CGI.bat" |
| | |
| | Media PHP-CGI |
| | |
| | ====== Task Scheduler ====== |
| | |
| | **** |
| | |
| | taskschd.msc |
| | |
| | ===== Update ===== |
| | |
| | * ''01:00:00 AM'' daily |
| | |
| | Media Update |
| | |
| | "%SystemDrive%\www\scripts\media\Update.bat" |
| | |
| | ===== Back-up ===== |
| | |
| | * Weekly -> Recur every ''1'' weeks on ''Monday'' |
| | * ''12:15:00 AM'' |
| | |
| | Wiki File Back-up |
| | |
| | "%SystemDrive%\www\scripts\media\Back-up.bat" |
| | |
| | ===== Maintenance ===== |
| | |
| | * Monthly -> All months -> Days: ''1'' |
| | * ''12:30:00 AM'' |
| | |
| | Wiki Maintenance |
| | |
| | "%SystemDrive%\www\scripts\media\Maintenance.bat" |
| |
| ====== Initial Setup ====== | ====== Initial Setup ====== |
| * [[https://github.com/Piwigo/Piwigo/blob/master/include/config_default.inc.php|More Settings]] | * [[https://github.com/Piwigo/Piwigo/blob/master/include/config_default.inc.php|More Settings]] |
| |
| notepad "%SystemDrive%\www\media\local\config\config.inc.php" | "notepad.exe" "%SystemDrive%\www\media\local\config\config.inc.php" |
| |
| <code> | <code> |
| // Minimal Logging | // Minimal Logging |
| $conf['log_level'] = 'EMERGENCY'; | $conf['log_level'] = 'EMERGENCY'; |
| | |
| | // Hide PHP Warnings |
| | $conf['show_php_errors'] = E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_WARNING; |
| |
| // Header Links | // Header Links |
| ?></code> | ?></code> |
| |
| ====== Albums ====== | ====== Albums Formatting ====== |
| |
| ===== 2004Scape (localhost) ===== | ===== 4 Links ===== |
| |
| * https://media.realmofespionage.xyz/index/category/2 | * https://media.realmofespionage.xyz/index/category/2 |
| </code> | </code> |
| |
| ===== 2009Scape (localhost) ===== | ===== Single Link ===== |
| |
| * https://media.realmofespionage.xyz/index/category/3 | * https://media.realmofespionage.xyz/picture/268/category/17 |
| |
| <code> | <code> |
| <a href="https://wiki.realmofespionage.xyz/servers;windows;games;2009scape_localhost" target="_blank" rel="noopener">Windows</a> | <a href="https://wiki.realmofespionage.xyz/servers;linux;games;2009scape_localhost" target="_blank" rel="noopener">Linux</a> | <a href="https://wiki.realmofespionage.xyz/servers;bsd;games;2009scape_localhost" target="_blank" rel="noopener">FreeBSD</a> | <a href="https://forum.2009scape.org/viewtopic.php?t=1038-singleplayer-server-rt4-client-master-branches-scripts-and-desktop-start-launchers-on-windows-linux" target="_blank" rel="noopener">2009Scape Forums</a> | <a href="https://wiki.realmofespionage.xyz/games;windows;dota_2_steamcmd" target="_blank" rel="noopener">Notes</a> |
| </code> | </code> |
| |
| ===== Diablo II ===== | ====== Files ====== |
| |
| * https://media.realmofespionage.xyz/index/category/9 | ===== Backup ===== |
| |
| <code> | **** |
| <a href="https://wiki.realmofespionage.xyz/games;windows;diablo_2" target="_blank" rel="noopener">Windows</a> | <a href="https://wiki.realmofespionage.xyz/games;linux;wine;diablo_2" target="_blank" rel="noopener">Linux</a> | <a href="https://wiki.realmofespionage.xyz/games;bsd;wine;diablo_2" target="_blank" rel="noopener">FreeBSD</a> | |
| </code> | |
| |
| ==== Espionage ==== | "tar.exe" -czf "%UserProfile%\Downloads\piwigo-files-manual-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "media" |
| |
| * https://media.realmofespionage.xyz/index/category/10 | ====== Database ====== |
| * :?: Needed different sorting order: Numeric 1-9 | |
| |
| <code>Amazon (Spear), SP, Classic (non-LoD), /players 1</code> | ===== Backup ===== |
| |
| ===== Old School RuneScape ===== | **** |
| |
| * https://media.realmofespionage.xyz/index/category/4 | CD "%UserProfile%\Downloads" && "%ProgramFiles%\MariaDB 12.1\bin\mariadb-dump.exe" -u "root" -p --opt -r "piwigo.sql" "piwigo" |
| |
| <code> | ===== Restore ===== |
| <a href="https://secure.runescape.com/m=hiscore_oldschool_hardcore_ironman/hiscorepersonal?user1=Espionage724" target="_blank" rel="noopener">Hardcore</a> | <a href="https://secure.runescape.com/m=hiscore_oldschool_ironman/hiscorepersonal?user1=Espionage724" target="_blank" rel="noopener">Ironman</a> | <a href="https://secure.runescape.com/m=hiscore_oldschool/hiscorepersonal?user1=Espionage724" target="_blank" rel="noopener">Overall</a> | <a href="https://oldschool.runescape.wiki/w/Special:Contributions/Espionage724" target="_blank" rel="noopener">OSRS Wiki</a> | |
| </code> | |
| |
| ===== RuneScape ===== | * [[#database|Initial set-up]] |
| |
| * https://media.realmofespionage.xyz/index/category/5 | "%ProgramFiles%\MariaDB 12.1\bin\mariadb.exe" -u "root" -p --execute="CREATE DATABASE piwigo" |
| |
| <code> | "%ProgramFiles%\MariaDB 12.1\bin\mariadb.exe" -u "root" -p "piwigo" < "%UserProfile%\Downloads\piwigo.sql" |
| <a href="https://secure.runescape.com/m=hiscore_hardcore_ironman/compare?user1=Espionage724" target="_blank" rel="noopener">Hardcore</a> | <a href="https://secure.runescape.com/m=hiscore_ironman/compare?user1=Espionage724" target="_blank" rel="noopener">Ironman</a> | <a href="https://secure.runescape.com/m=hiscore/compare?user1=Espionage724" target="_blank" rel="noopener">Overall</a> | <a href="https://apps.runescape.com/runemetrics/app/overview/player/Espionage724" target="_blank" rel="noopener">RuneMetrics</a> | <a href="https://runescape.wiki/w/Special:Contributions/Espionage724" target="_blank" rel="noopener">RuneScape Wiki</a> | |
| </code> | |
| |
| ===== World of Warcraft 3.3.5 ===== | ====== TODOs ====== |
| |
| * https://media.realmofespionage.xyz/index/category/6 | * Show title on pictures (long titles get cut-off in navbar) |
| | * AI ([[https://piwigo.org/forum/viewtopic.php?pid=192438#p192438|post]], [[https://github.com/Piwigo/Piwigo/commits/master/include/config_default.inc.php|config.inc.php]]) |
| <code> | |
| <a href="https://wiki.realmofespionage.xyz/servers;windows;games;trinitycore_3.3.5_localhost" target="_blank" rel="noopener">Windows</a> | <a href="https://wiki.realmofespionage.xyz/servers;linux;games;trinitycore_3.3.5_localhost" target="_blank" rel="noopener">Linux</a> | <a href="https://wiki.realmofespionage.xyz/servers;bsd;games;trinitycore_3.3.5_localhost" target="_blank" rel="noopener">FreeBSD</a> | <a href="https://talk.trinitycore.org/t/singleplayer-scripts-and-desktop-start-launchers-on-windows-linux-freebsd/33293" target="_blank" rel="noopener">TrinityCore Forums</a> | |
| </code> | |
| |