| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| servers:linux:nginx:piwigo [2026/05/01 00:12] – [PHP-FPM Socket] Sean Rhone | servers:linux:nginx:piwigo [2026/05/01 05:24] (current) – [PHP-FPM Socket] Sean Rhone |
|---|
| pm.process_idle_timeout = "30" | pm.process_idle_timeout = "30" |
| |
| php_value[log_errors] = "Off" | php_value[log_errors] = "0" |
| php_value[error_reporting] = "~E_ALL" | php_value[error_reporting] = "~E_ALL" |
| php_value[display_errors] = "Off" | php_value[display_errors] = "0" |
| php_value[display_startup_errors] = "Off" | php_value[display_startup_errors] = "0" |
| php_value[html_errors] = "Off" | php_value[html_errors] = "0" |
| |
| php_value[session.save_path] = "/var/lib/php8/sessions" | php_value[session.save_path] = "/var/lib/php8/sessions" |
| |
| <code> | <code> |
| location '~' '\.(php|phar)(/.*)?$' { | location '~' '\.(php|phar)(/.*)?$' { |
| | fastcgi_split_path_info '^(.+\.(?:php|phar))(/.*)$'; |
| fastcgi_split_path_info '^(.+\.(?:php|phar))(/.*)$'; | fastcgi_intercept_errors 'on'; |
| fastcgi_intercept_errors 'on'; | fastcgi_index 'index.php'; |
| fastcgi_index 'index.php'; | include 'fastcgi_params'; |
| include '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 'unix:/run/php-fpm/media.sock'; |
| | } |
| fastcgi_pass 'unix:/run/php-fpm/media.sock'; | |
| | |
| } | |
| |
| # End</code> | # End</code> |
| <code> | <code> |
| server { | server { |
| |
| listen '443' 'ssl'; | listen '443' 'ssl'; |
| http2 'on'; | http2 'on'; |
| rewrite '^/i((/|$).*)$' '/i.php$1' 'last'; | rewrite '^/i((/|$).*)$' '/i.php$1' 'last'; |
| } | } |
| |
| } | } |
| |
| $conf['links'] = array( | $conf['links'] = array( |
| 'https://realmofespionage.xyz' => 'Realm of Espionage', | 'https://realmofespionage.xyz' => 'Realm of Espionage', |
| 'https://wiki.realmofespionage.xyz/start' => 'RoE | Wiki', | 'https://wiki.realmofespionage.xyz' => 'RoE | Wiki', |
| 'https://blog.realmofespionage.xyz' => 'RoE | Blog', | 'https://blog.realmofespionage.xyz' => 'RoE | Blog', |
| 'https://social.realmofespionage.xyz/profile/espionage724' => 'RoE | Social', | 'https://social.realmofespionage.xyz/profile/espionage724' => 'RoE | Social', |
| 'https://forums.realmofespionage.xyz' => 'RoE | Forums', | '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:linux:nginx:piwigo' => 'Instance Configuration Notes', | 'https://wiki.realmofespionage.xyz/servers:linux:nginx:piwigo' => 'Instance Configuration Notes', |
| $conf['file_ext'] = array_merge( | $conf['file_ext'] = array_merge( |
| $conf['picture_ext'], | $conf['picture_ext'], |
| array('mp4','webmv','m4v','webm','mov') | array('mp4') |
| ); | ); |
| |
| // End | // End |
| ?></code> | ?></code> |
| |
| ====== Scripts ====== | |
| |
| ===== Git Fix ===== | |
| |
| * :!: Set email for **both** ''user.email'' | |
| |
| sudo mkdir -p '/etc/nginx/scripts/media' && sudo -e '/etc/nginx/scripts/media/git-fix.sh' && sudo chmod '0500' '/etc/nginx/scripts/media/git-fix.sh' && sudo chown 'wwwrun':'www' '/etc/nginx/scripts/media/git-fix.sh' | |
| |
| <code> | |
| #!/bin/bash | |
| |
| cd '/tmp' | |
| |
| '/usr/bin/rm' -Rf '/srv/www/media/.git' | |
| '/usr/bin/git' -C '/srv/www/media' init --initial-branch='master' | |
| '/usr/bin/git' -C '/srv/www/media' add '.' | |
| |
| ######################################## | |
| '/usr/bin/git' -C '/srv/www/media' config 'user.email' 'espionage724@x' | |
| ######################################## | |
| |
| '/usr/bin/git' -C '/srv/www/media' commit --message='x' | |
| |
| '/usr/bin/git' -C '/srv/www/media' remote add 'origin' 'https://github.com/Piwigo/Piwigo.git' | |
| '/usr/bin/git' -C '/srv/www/media' pull --depth '1' --recurse-submodules 'origin' 'master' --rebase | |
| |
| '/usr/bin/git' -C '/srv/www/media' reset --hard 'origin/master' | |
| '/usr/bin/git' -C '/srv/www/media' gc --aggressive --prune='all' | |
| '/usr/bin/git' -C '/srv/www/media' fsck --full --strict | |
| |
| '/usr/bin/rm' -Rf '/srv/www/media/themes/bootstrap_darkroom/.git' | |
| '/usr/bin/git' -C '/srv/www/media/themes/bootstrap_darkroom' init --initial-branch='master' | |
| '/usr/bin/git' -C '/srv/www/media/themes/bootstrap_darkroom' add '.' | |
| |
| ######################################## | |
| '/usr/bin/git' -C '/srv/www/media/themes/bootstrap_darkroom' config 'user.email' 'espionage724@x' | |
| ######################################## | |
| |
| '/usr/bin/git' -C '/srv/www/media/themes/bootstrap_darkroom' commit --message='x' | |
| |
| '/usr/bin/git' -C '/srv/www/media/themes/bootstrap_darkroom' remote add 'origin' 'https://github.com/Piwigo/piwigo-bootstrap-darkroom.git' | |
| '/usr/bin/git' -C '/srv/www/media/themes/bootstrap_darkroom' pull --depth '1' --recurse-submodules 'origin' 'master' --rebase | |
| |
| '/usr/bin/git' -C '/srv/www/media/themes/bootstrap_darkroom' reset --hard 'origin/master' | |
| '/usr/bin/git' -C '/srv/www/media/themes/bootstrap_darkroom' gc --aggressive --prune='all' | |
| '/usr/bin/git' -C '/srv/www/media/themes/bootstrap_darkroom' fsck --full --strict | |
| |
| # End</code> | |
| |
| ==== Execute ==== | |
| |
| sudo su 'wwwrun' -s '/bin/bash' | |
| |
| '/etc/nginx/scripts/media/git-fix.sh' | |
| |
| exit | |
| |
| ====== Services ====== | ====== Services ====== |
| Type=oneshot | Type=oneshot |
| |
| WorkingDirectory=/srv/www/media | WorkingDirectory=/tmp |
| |
| ExecStart='/usr/bin/git' -C '/srv/www/media' reset --hard 'origin/master' | ExecStart='/usr/bin/git' -C '/srv/www/media' reset --hard 'origin/master' |
| ExecStart='/usr/bin/git' -C '/srv/www/media/themes/bootstrap_darkroom' reset --hard 'origin/master' | ExecStart='/usr/bin/git' -C '/srv/www/media/themes/bootstrap_darkroom' reset --hard 'origin/master' |
| ExecStart='/usr/bin/git' -C '/srv/www/media/themes/bootstrap_darkroom' pull origin 'master' --rebase | ExecStart='/usr/bin/git' -C '/srv/www/media/themes/bootstrap_darkroom' pull origin 'master' --rebase |
| |
| ExecStartPost='/usr/bin/sync' | |
| |
| # End</code> | # End</code> |
| |
| === Service === | === Service === |
| | |
| | * [[linux:notes:ext4|ext4 NAS]] |
| |
| mkdir -p ~/'backups' && sudo -e '/etc/systemd/system/media-fb.service' && sudo sed -i 's/CHANGEME/'$USER'/g' '/etc/systemd/system/media-fb.service' | mkdir -p ~/'backups' && sudo -e '/etc/systemd/system/media-fb.service' && sudo sed -i 's/CHANGEME/'$USER'/g' '/etc/systemd/system/media-fb.service' |
| Type=oneshot | Type=oneshot |
| |
| WorkingDirectory=/srv/www/media | WorkingDirectory=/tmp |
| |
| ExecStart='/usr/bin/bash' -c '"/usr/bin/tar" -czf "/home/CHANGEME/backups/piwigo-files-auto-"$$(date +%%Y-%%m-%%d)".tar.gz" -C "/srv/www" "media"' | ExecStart='/usr/bin/bash' -c '"/usr/bin/tar" -czf "/mnt/NAS1/Servers/Scheduled Backups/piwigo-files-auto-"$$(date +%%Y-%%m-%%d)".tar.gz" -C "/srv/www" "media"' |
| |
| ExecStartPost='/usr/bin/sync' | #ExecStart='/usr/bin/bash' -c '"/usr/bin/tar" -czf "/home/CHANGEME/backups/piwigo-files-auto-"$$(date +%%Y-%%m-%%d)".tar.gz" -C "/srv/www" "media"' |
| |
| # End</code> | # End</code> |
| |
| === Service === | === Service === |
| | |
| | * [[linux:notes:ext4|ext4 NAS]] |
| |
| mkdir -p ~/'backups' && sudo mkdir -p '/srv/lib/mysql/tmp' && sudo -e '/etc/systemd/system/media-db.service' && sudo sed -i 's/'CHANGEME'/'$USER'/g' '/etc/systemd/system/media-db.service' | mkdir -p ~/'backups' && sudo mkdir -p '/srv/lib/mysql/tmp' && sudo -e '/etc/systemd/system/media-db.service' && sudo sed -i 's/'CHANGEME'/'$USER'/g' '/etc/systemd/system/media-db.service' |
| Type=oneshot | Type=oneshot |
| |
| WorkingDirectory=/srv/lib/mysql | WorkingDirectory=/tmp |
| |
| ExecStart='/usr/bin/bash' -c '"/usr/bin/mariadb-dump" --defaults-extra-file="/srv/lib/mysql/auth/piwigo" --single-transaction --quick "piwigo" -r "/home/CHANGEME/backups/piwigo-database-auto-"$$(date +%%Y-%%m-%%d)".sql"' | ExecStart='/usr/bin/bash' -c '"/usr/bin/mariadb-dump" --defaults-extra-file="/srv/lib/mysql/auth/piwigo" --single-transaction --quick "piwigo" -r "/mnt/NAS1/Servers/Scheduled Backups/piwigo-database-auto-"$$(date +%%Y-%%m-%%d)".sql"' |
| |
| ExecStartPost='/usr/bin/sync' | #ExecStart='/usr/bin/bash' -c '"/usr/bin/mariadb-dump" --defaults-extra-file="/srv/lib/mysql/auth/piwigo" --single-transaction --quick "piwigo" -r "/home/CHANGEME/backups/piwigo-database-auto-"$$(date +%%Y-%%m-%%d)".sql"' |
| |
| # End</code> | # End</code> |
| Type=oneshot | Type=oneshot |
| |
| WorkingDirectory=/srv/www/media | WorkingDirectory=/tmp |
| |
| ExecStart='/usr/bin/git' -C '/srv/www/media' gc --aggressive --prune='all' | ExecStart='/usr/bin/git' -C '/srv/www/media' gc --aggressive --prune='all' |
| ExecStart='/usr/bin/git' -C '/srv/www/media/themes/bootstrap_darkroom' gc --aggressive --prune='all' | ExecStart='/usr/bin/git' -C '/srv/www/media/themes/bootstrap_darkroom' gc --aggressive --prune='all' |
| ExecStart='/usr/bin/git' -C '/srv/www/media/themes/bootstrap_darkroom' fsck --full --strict | ExecStart='/usr/bin/git' -C '/srv/www/media/themes/bootstrap_darkroom' fsck --full --strict |
| |
| ExecStartPost='/usr/bin/sync' | |
| |
| # End</code> | # End</code> |
| sudo su 'wwwrun' -s '/bin/bash' | sudo su 'wwwrun' -s '/bin/bash' |
| |
| rm -Rf '/srv/www/media/.git' | cd '/tmp' && rm -Rf '/srv/www/media/.git' |
| |
| git -C '/srv/www/media' init --initial-branch='master' | git -C '/srv/www/media' init --initial-branch='master' |
| |
| ===== MySQL Connection ===== | ===== MySQL Connection ===== |
| |
| * Windows uses ''127.0.0.1'' | |
| |
| sudo -e '/srv/www/media/local/config/database.inc.php' && sudo chown -v 'wwwrun':'www' '/srv/www/media/local/config/database.inc.php' | sudo -e '/srv/www/media/local/config/database.inc.php' && sudo chown -v 'wwwrun':'www' '/srv/www/media/local/config/database.inc.php' |
| rm -fv ~/'piwigo-files-'*'.tar.gz' ~/'piwigo'*'.sql' | rm -fv ~/'piwigo-files-'*'.tar.gz' ~/'piwigo'*'.sql' |
| |
| ====== TODOs ====== | ====== Resources ====== |
| | |
| | ===== Albums Formatting ===== |
| | |
| | * :!: Using Emojis (like 8-) from [[https://emojipedia.org/smiling-face-with-sunglasses|Emojipedia]]) in comments caused a MySQL exception |
| | |
| | ==== 4 Links ==== |
| | |
| | * https://media.realmofespionage.xyz/index/category/2 |
| | |
| | <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> |
| | |
| | ====== 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]]) | * 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]]) |
| * :?: Below is remaining packages not installed from old installs | * :?: Below is remaining packages not installed from old installs ((bz2/zlib seem installed with wiki; TODO: source for those being reqs)) |
| |
| sudo dnf install libvorbis poppler-utils | sudo dnf install libvorbis poppler-utils |