User Tools

Site Tools


servers:windows:nginx:piwigo

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:piwigo [2026/01/17 08:27] Sean Rhoneservers:windows:nginx:piwigo [2026/02/01 20:41] (current) – [Albums Formatting] Sean Rhone
Line 1: Line 1:
 ====== Information ====== ====== Information ======
  
-  * Piwigo ((https://piwigo.org/)) +  * Piwigo ((https://www.piwigo.org/)) 
-  * Bootstrap Darkroom Theme ((https://github.com/Piwigo/piwigo-bootstrap-darkroom)) +  * Bootstrap Darkroom Theme ((https://piwigo.org/ext/index.php?eid=831)) ((https://doc.piwigo.org/piwigo-themes/bootstrap-darkroom-theme-piwigo)) 
-  * [[Information:Realm of Espionage]]+  * [[information;realm_of_espionage|Realm of Espionage]]
   * https://media.realmofespionage.xyz   * https://media.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 34: Line 34:
 ====== Database ====== ====== Database ======
  
-  "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" -p+  "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root"
  
   CREATE DATABASE piwigo;   CREATE DATABASE piwigo;
Line 44: Line 44:
   FLUSH PRIVILEGES;EXIT;   FLUSH PRIVILEGES;EXIT;
  
-====== Environment ======+====== nginx + PHP-CGI Configuration ======
  
 ===== PHP ===== ===== PHP =====
Line 76: Line 76:
  
   "php.exe" -c "%SystemDrive%\www\php\media.ini" -m   "php.exe" -c "%SystemDrive%\www\php\media.ini" -m
- 
-====== nginx + PHP-CGI Configuration ====== 
  
 ===== PHP-CGI ===== ===== PHP-CGI =====
Line 85: Line 83:
 <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 95: Line 92:
  
  fastcgi_pass "127.0.0.1:9003";  fastcgi_pass "127.0.0.1:9003";
-  
 } }
  
Line 106: Line 102:
 <code> <code>
 server { server {
- 
  listen "443" "ssl";  listen "443" "ssl";
  http2 "on";  http2 "on";
Line 131: Line 126:
   rewrite "^/i((/|$).*)$" "/i.php$1" "last";   rewrite "^/i((/|$).*)$" "/i.php$1" "last";
  }  }
- 
 } }
  
Line 139: Line 133:
  
 ====== Scripts ====== ====== Scripts ======
- 
-===== Folder ===== 
  
   MKDIR "%SystemDrive%\www\scripts\media"   MKDIR "%SystemDrive%\www\scripts\media"
Line 152: Line 144:
 <code> <code>
 @echo off @echo off
 +
 +CD "%Temp%"
  
 SET "PHP_FCGI_MAX_REQUESTS=0" SET "PHP_FCGI_MAX_REQUESTS=0"
Line 157: Line 151:
  
 START "Media PHP-CGI" /MIN "php-cgi.exe" -b "127.0.0.1:9003" -c "%SystemDrive%\www\php\media.ini" -q START "Media PHP-CGI" /MIN "php-cgi.exe" -b "127.0.0.1:9003" -c "%SystemDrive%\www\php\media.ini" -q
 +
 +SET "PHP_FCGI_MAX_REQUESTS="
 +SET "PHP_FCGI_CHILDREN="
  
 :: End</code> :: End</code>
Line 170: Line 167:
  
 TITLE Media Updater TITLE Media Updater
 +CD "%Temp%"
  
 "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" reset --hard "origin/master" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" reset --hard "origin/master"
Line 182: Line 180:
  
 ===== Back-up ===== ===== Back-up =====
- 
-  * ''D:\Servers\Scheduled Backups'' 
  
   "notepad.exe" "%SystemDrive%\www\scripts\media\Back-up.bat"   "notepad.exe" "%SystemDrive%\www\scripts\media\Back-up.bat"
Line 191: Line 187:
  
 TITLE Media Back-up TITLE Media Back-up
 +CD "%Temp%"
  
-:: User\Downloads 
-::"tar.exe" -czf "%UserProfile%\Downloads\piwigo-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "media" 
-::"%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" --opt -r "%UserProfile%\Downloads\%RANDOM%-piwigo.sql" "piwigo" 
- 
-:: NAS 
 "tar.exe" -czf "D:\Servers\Scheduled Backups\piwigo-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "media" "tar.exe" -czf "D:\Servers\Scheduled Backups\piwigo-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "media"
 "%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" --opt -r "D:\Servers\Scheduled Backups\%RANDOM%-piwigo.sql" "piwigo" "%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" --opt -r "D:\Servers\Scheduled Backups\%RANDOM%-piwigo.sql" "piwigo"
 +
 +::"tar.exe" -czf "%UserProfile%\Downloads\piwigo-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "media"
 +::"%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" --opt -r "%UserProfile%\Downloads\%RANDOM%-piwigo.sql" "piwigo"
  
 :: End</code> :: End</code>
Line 212: Line 207:
  
 TITLE Media Maintenance TITLE Media Maintenance
 +CD "%Temp%"
  
-CALL "%SystemDrive%\www\scripts\media\Git Fix.bat"+"%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\themes\bootstrap_darkroom" gc --aggressive --prune="all" 
 +"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroomfsck --full --strict
  
 :: End</code> :: End</code>
Line 221: Line 221:
 ===== Git Fix ===== ===== Git Fix =====
  
-  * :!: Set email for both ''user.email''+  * :!: Set **both** ''user.email''
  
   "notepad.exe" "%SystemDrive%\www\scripts\media\Git Fix.bat"   "notepad.exe" "%SystemDrive%\www\scripts\media\Git Fix.bat"
Line 229: Line 229:
  
 TITLE Media Git Fix TITLE Media Git Fix
 +CD "%Temp%"
  
-:################### +::################## 
-:# Piwigo +::# Piwigo 
-:###################+::##################
  
 RMDIR /S /Q "%SystemDrive%\www\media\.git" RMDIR /S /Q "%SystemDrive%\www\media\.git"
Line 238: Line 239:
 "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" add "." "%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" config "user.email" "espionage724@x"
-:#######################################+::######################################
  
 "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" commit --message="x" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" commit --message="x"
Line 251: Line 252:
 "%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 
-:###################+::##################
  
 RMDIR /S /Q "%SystemDrive%\www\media\themes\bootstrap_darkroom\.git" RMDIR /S /Q "%SystemDrive%\www\media\themes\bootstrap_darkroom\.git"
Line 259: Line 260:
 "%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" 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" 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" commit --message="x"
Line 276: Line 277:
   "%SystemDrive%\www\scripts\media\Git Fix.bat"   "%SystemDrive%\www\scripts\media\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 "Media PHP-CGI/TR "%SystemDrive%\www\scripts\media\PHP-CGI.bat" /F
- +
-  "%SystemDrive%\www\scripts\media\PHP-CGI.bat" +
- +
-  Media PHP-CGI +
- +
-====== Task Scheduler ====== +
- +
-**** +
- +
-  taskschd.msc+
  
 ===== Update ===== ===== Update =====
  
-  * ''1:00:00 AM'' daily+  * Daily ''01:00:00 AM''
  
-  Media Update +  SCHTASKS /Create /SC "DAILY" /TN "Media Update" /TR "%SystemDrive%\www\scripts\media\Update.bat" /ST "01:00" /F
- +
-  "%SystemDrive%\www\scripts\media\Update.bat" +
- +
-  SCHTASKS /Create /SC "ONCE" /TN "Media Update" /TR "%SystemDrive%\www\scripts\media\Update.bat" /ST "01:00" /F+
  
 ===== Back-up ===== ===== Back-up =====
  
-  * Monthly -> All months -> Days: ''2'' +  * Monthly (2nd) ''01:10:00 AM''
-  * ''1:15:00 AM''+
  
-  Media Back-up +  SCHTASKS /Create /SC "MONTHLY" /D "2" /M "*" /TN "Media Back-up" /TR "%SystemDrive%\www\scripts\media\Back-up.bat" /ST "01:10" /F
- +
-  "%SystemDrive%\www\scripts\media\Back-up.bat" +
- +
-  SCHTASKS /Create /SC "MONTHLY" /D "2" /M "*" /TN "Media Back-up" /TR "%SystemDrive%\www\scripts\media\Back-up.bat" /ST "01:15" /F+
  
 ===== Maintenance ===== ===== Maintenance =====
  
-  * Monthly -> All months -> Days: ''2'' +  * Monthly (2nd) ''01:30:00 AM''
-  * ''1:30:00 AM'' +
- +
-  Media Maintenance +
- +
-  "%SystemDrive%\www\scripts\media\Maintenance.bat"+
  
   SCHTASKS /Create /SC "MONTHLY" /D "2" /M "*" /TN "Media Maintenance" /TR "%SystemDrive%\www\scripts\media\Maintenance.bat" /ST "01:30" /F   SCHTASKS /Create /SC "MONTHLY" /D "2" /M "*" /TN "Media Maintenance" /TR "%SystemDrive%\www\scripts\media\Maintenance.bat" /ST "01:30" /F
Line 345: Line 322:
 ===== config.inc.php ===== ===== config.inc.php =====
  
 +  * [[https://piwigo.org/forum/viewtopic.php?pid=159584#p159584|nginx Rewrite source]]
 +  * [[https://doc.piwigo.org/import-and-manage-photos/file-formats-compatible-piwigo#block-5cef6409208a4b3ead19b930f85942b2|Video Uploading source]]
   * [[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]]
  
Line 360: Line 339:
  
 // Hide PHP Warnings // Hide PHP Warnings
-$conf['show_php_errors'] = '0';+$conf['show_php_errors'] = E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_WARNING;
  
 // Header Links // Header Links
 $conf['links'] = array( $conf['links'] = array(
   'https://realmofespionage.xyz' => 'Realm of Espionage',   'https://realmofespionage.xyz' => 'Realm of Espionage',
-  'https://wiki.realmofespionage.xyz' => 'RoE | Wiki', +  'https://wiki.realmofespionage.xyz/start' => 'RoE | Wiki', 
-  'https://blog.realmofespionage.xyz' => 'RoE | Blog',+  'https://blog.realmofespionage.xyz/' => 'RoE | Blog', 
 +  'https://social.realmofespionage.xyz/profile/espionage724' => 'RoE | Social', 
 +  'https://forums.realmofespionage.xyz/' => 'RoE | Forums', 
 +  'https://status.realmofespionage.xyz/' => 'RoE | Status',
   'https://wiki.realmofespionage.xyz/user;espionage724' => 'Webmaster Info',   'https://wiki.realmofespionage.xyz/user;espionage724' => 'Webmaster Info',
   'https://wiki.realmofespionage.xyz/servers;windows;nginx;piwigo' => 'Instance Configuration Notes',   'https://wiki.realmofespionage.xyz/servers;windows;nginx;piwigo' => 'Instance Configuration Notes',
Line 373: Line 355:
 // Video Uploading // Video Uploading
 $conf['upload_form_all_types'] = true; $conf['upload_form_all_types'] = true;
 +
 $conf['file_ext'] = array_merge( $conf['file_ext'] = array_merge(
   $conf['picture_ext'],   $conf['picture_ext'],
-  array('tiff', 'tif', 'mpg','zip','avi','mp3','ogg','pdf','webm','mp4')+  array('mp4','webmv','m4v','webm','mov')
   );   );
  
Line 381: Line 364:
 ?></code> ?></code>
  
-====== Albums Formatting ======+===== database.inc.php =====
  
-===== 4 Links =====+  * :!: Change ''db_password''
  
-  * https://media.realmofespionage.xyz/index/category/2+  "notepad.exe" "%SystemDrive%\www\media\local\config\config.inc.php"
  
 <code> <code>
-<a href="https://wiki.realmofespionage.xyz/games;windows;2004scape_localhost" target="_blank" rel="noopener">Windows</a> | <a href="https://wiki.realmofespionage.xyz/games;linux;2004scape_localhost" target="_blank" rel="noopener">Linux</a> | <a href="https://wiki.realmofespionage.xyz/games;bsd;2004scape_localhost" target="_blank" rel="noopener">FreeBSD</a> | <a href="https://lostcity.rs/t/singleplayer-main-branch-scripts-and-desktop-start-launchers-on-windows-linux-freebsd/54" target="_blank" rel="noopener">Lost City Forums</a> +<?php 
-</code>+$conf['dblayer''mysqli'; 
 +$conf['db_base'] = 'piwigo'; 
 +$conf['db_user''piwigo'; 
 +$conf['db_password''x'; 
 +$conf['db_host''localhost';
  
-===== Single Link =====+$prefixeTable 'piwigo_';
  
-  * https://media.realmofespionage.xyz/picture/268/category/17+define('PHPWG_INSTALLED', true); 
 +define('PWG_CHARSET', 'utf-8'); 
 +define('DB_CHARSET', 'utf8'); 
 +define('DB_COLLATE', '');
  
-<code> +?></code>
-<a href="https://wiki.realmofespionage.xyz/games;windows;dota_2_steamcmd" target="_blank" rel="noopener">Notes</a> +
-</code>+
  
-====== Files ======+====== Backup ======
  
-===== Backup =====+===== Folder =====
  
 **** ****
Line 407: Line 395:
   "tar.exe" -czf "%UserProfile%\Downloads\piwigo-files-manual-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "media"   "tar.exe" -czf "%UserProfile%\Downloads\piwigo-files-manual-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "media"
  
-====== Database ====== +===== Database =====
- +
-===== Backup =====+
  
 **** ****
  
-  CD "%UserProfile%\Downloads" && "%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" -p --opt -r "piwigo.sql" "piwigo"+  CD "%UserProfile%\Downloads" && "%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" --opt -r "piwigo.sql" "piwigo"
  
-===== Restore =====+====== Restore ====== 
 + 
 +===== Database =====
  
   * [[#database|Initial set-up]]   * [[#database|Initial set-up]]
  
-  "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" -p --execute="CREATE DATABASE piwigo"+  "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" --execute="CREATE DATABASE piwigo"
  
-  "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" -p "piwigo" < "%UserProfile%\Downloads\piwigo.sql"+  "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" "piwigo" < "%UserProfile%\Downloads\piwigo.sql" 
 + 
 +====== Resources ====== 
 + 
 +===== Albums Formatting ===== 
 + 
 +  * :!: Using Emojis (like 8-) from [[https://emojipedia.org/smiling-face-with-sunglasses|Emojipedia]]) in comments causes MySQL exception 
 + 
 +==== 4 Links ==== 
 + 
 +  * https://media.realmofespionage.xyz/index/category/
 + 
 +<code> 
 +<a href="https://wiki.realmofespionage.xyz/games;windows;2004scape_localhost" target="_blank" rel="noopener">Windows</a> | <a href="https://wiki.realmofespionage.xyz/games;linux;2004scape_localhost" target="_blank" rel="noopener">Linux</a> | <a href="https://wiki.realmofespionage.xyz/games;bsd;2004scape_localhost" target="_blank" rel="noopener">FreeBSD</a> | <a href="https://lostcity.rs/t/singleplayer-main-branch-scripts-and-desktop-start-launchers-on-windows-linux-freebsd/54" target="_blank" rel="noopener">Lost City Forums</a> 
 +</code> 
 + 
 +==== Single Link ==== 
 + 
 +  * https://media.realmofespionage.xyz/picture/268/category/17 
 + 
 +<code> 
 +<a href="https://wiki.realmofespionage.xyz/games;windows;dota_2_steamcmd" target="_blank" rel="noopener">Notes</a> 
 +</code>
  
-====== TODOs ======+====== TODO ======
  
   * Show title on pictures (long titles get cut-off in navbar)   * 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]]) 
  
/usr/local/www/wiki/data/attic/servers/windows/nginx/piwigo.1768656447.txt.gz · Last modified: by Sean Rhone