User Tools

Site Tools


servers:linux: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:linux:nginx:piwigo [2025/09/11 07:55] Sean Rhoneservers:linux:nginx:piwigo [2025/10/16 23:22] (current) – [Database] Sean Rhone
Line 37: Line 37:
   * https://github.com/Piwigo/piwigo-bootstrap-darkroom/commits/master/   * https://github.com/Piwigo/piwigo-bootstrap-darkroom/commits/master/
  
-  sudo git clone --branch 'master' --depth '1' --recurse-submodules 'https://github.com/Piwigo/Piwigo.git' '/srv/www/media' && sudo chown -R 'wwwrun':'www' '/srv/www/media'+  sudo git clone --branch 'master' --depth '1' --recurse-submodules 'https://github.com/Piwigo/Piwigo.git' '/srv/www/media' && sudo chown -R 'wwwrun':'www' '/srv/www/media' && sudo chmod -R '0755' '/srv/www/media'
  
-  sudo git clone --branch 'master' --depth '1' --recurse-submodules 'https://github.com/Piwigo/piwigo-bootstrap-darkroom.git' '/srv/www/media/themes/bootstrap_darkroom' && sudo chown -R 'wwwrun':'www' '/srv/www/media/themes'+  sudo git clone --branch 'master' --depth '1' --recurse-submodules 'https://github.com/Piwigo/piwigo-bootstrap-darkroom.git' '/srv/www/media/themes/bootstrap_darkroom' && sudo chown -R 'wwwrun':'www' '/srv/www/media/themes' && sudo chmod -R '0755' '/srv/www/media/themes'
  
 ====== Database ====== ====== Database ======
Line 51: Line 51:
   GRANT ALL PRIVILEGES ON piwigo.* to 'piwigo'@'localhost';   GRANT ALL PRIVILEGES ON piwigo.* to 'piwigo'@'localhost';
  
-  FLUSH PRIVILEGES; +  FLUSH PRIVILEGES;EXIT;
- +
-  EXIT+
  
 ====== nginx + PHP-FPM Configuration ====== ====== nginx + PHP-FPM Configuration ======
Line 83: Line 81:
  
 ; General ; General
 +php_value[log_errors] = "0"
 +php_value[error_reporting] = "~E_ALL"
 php_value[date.timezone] = "America/New_York" php_value[date.timezone] = "America/New_York"
 php_value[max_execution_time] = "200" php_value[max_execution_time] = "200"
Line 246: Line 246:
  
 # End</code> # End</code>
- 
-===== Maintenance ===== 
- 
-==== Service ==== 
- 
-  sudo -e '/etc/systemd/system/media-m.service' 
- 
-<code> 
-[Service] 
-User=wwwrun 
-Group=www 
-Type=oneshot 
- 
-ExecStart='/usr/bin/git' -C '/srv/www/media' gc --aggressive --prune='all' 
-ExecStart='/usr/bin/git' -C '/srv/www/media' fsck --full --strict 
- 
-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 
- 
-ExecStartPost='/usr/bin/sync' 
- 
-# End</code> 
- 
-==== Timer ==== 
- 
-  * ''01'' day of every month at ''01:30:00'' 
- 
-  sudo -e '/etc/systemd/system/media-m.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'media-m.timer' --now 
- 
-<code> 
-[Unit] 
-Description=Piwigo Maintenance 
-After=network-online.target 
-Wants=network-online.target 
- 
-[Timer] 
-OnCalendar=*-*-01 01:30:00 
-Persistent=true 
- 
-[Install] 
-WantedBy=timers.target 
- 
-# End</code> 
- 
-  sudo systemctl start 'media-m' && sudo systemctl status 'media-m' -l 
  
 ===== Backup ===== ===== Backup =====
Line 350: Line 305:
 <code> <code>
 [Service] [Service]
 +Group=mysql
 Type=oneshot Type=oneshot
-WorkingDirectory=/var/lib/mysql/tmp + 
-ExecStartPre='/usr/bin/mariadb-dump--defaults-extra-file='/var/lib/mysql/auth/piwigo--single-transaction 'piwigo' -r '/var/lib/mysql/tmp/piwigo.sql' +ExecStart='/usr/bin/bash' -c '"/usr/bin/mariadb-dump--defaults-extra-file="/var/lib/mysql/auth/piwigo--single-transaction --quick "piwigo" -r "/home/CHANGEME/backups/piwigo-database-auto-"$$(date +%%Y-%%m-%%d)".sql"' 
-ExecStart='/usr/bin/gzip' -f '/var/lib/mysql/tmp/piwigo.sql' + 
-ExecStart='/usr/bin/bash' -c '"/usr/bin/mv" "/var/lib/mysql/tmp/piwigo.sql.gz" "/home/CHANGEME/backups/piwigo-database-auto-"$$(date +%%Y-%%m-%%d)".sql.gz"' +ExecStartPost='/usr/bin/sync' 
-ExecStartPost='/usr/bin/sync'</code>+ 
 +# End</code>
  
 === Timer === === Timer ===
Line 376: Line 333:
  
 # End</code> # End</code>
 +
 +===== Maintenance =====
 +
 +==== Service ====
 +
 +  sudo -e '/etc/systemd/system/media-m.service'
 +
 +<code>
 +[Service]
 +User=wwwrun
 +Group=www
 +Type=oneshot
 +
 +ExecStart='/usr/bin/git' -C '/srv/www/media' reset --hard
 +ExecStart='/usr/bin/git' -C '/srv/www/media' gc --aggressive --prune='all'
 +ExecStart='/usr/bin/git' -C '/srv/www/media' fsck --full --strict
 +
 +ExecStart='/usr/bin/git' -C '/srv/www/media/themes/bootstrap_darkroom' reset --hard
 +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
 +
 +ExecStartPost='/usr/bin/sync'
 +
 +# End</code>
 +
 +==== Timer ====
 +
 +  * ''01'' day of every month at ''01:30:00''
 +
 +  sudo -e '/etc/systemd/system/media-m.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'media-m.timer' --now
 +
 +<code>
 +[Unit]
 +Description=Piwigo Maintenance
 +After=network-online.target
 +Wants=network-online.target
 +
 +[Timer]
 +OnCalendar=*-*-01 01:30:00
 +Persistent=true
 +
 +[Install]
 +WantedBy=timers.target
 +
 +# End</code>
 +
 +  sudo systemctl start 'media-m' && sudo systemctl status 'media-m' -l
  
 ====== Backup ====== ====== Backup ======
Line 433: Line 437:
   sudo mariadb 'piwigo' < ~/'piwigo'*'.sql'   sudo mariadb 'piwigo' < ~/'piwigo'*'.sql'
  
-===== dos2unix =====+===== Git Fix =====
  
-****+  :!: Set email for ''user.email'' 
 + 
 +  sudo su 'wwwrun' -s '/bin/bash' 
 + 
 +  rm -Rf '/srv/www/media/.git' 
 + 
 +  git -C '/srv/www/media' init --initial-branch='master' 
 + 
 +  git -C '/srv/www/media' add '.' 
 + 
 +  git -C '/srv/www/media' config 'user.email' 'espionage724@x' 
 + 
 +  git -C '/srv/www/media' commit --message='x' 
 + 
 +  git -C '/srv/www/media' remote add 'origin' 'https://github.com/Piwigo/Piwigo.git' 
 + 
 +  git -C '/srv/www/media' pull --depth '1' --recurse-submodules 'origin' 'master' --rebase 
 + 
 +  git -C '/srv/www/media' reset --hard 'origin/master' 
 + 
 +  git -C '/srv/www/media' gc --aggressive --prune='all' 
 + 
 +  git -C '/srv/www/media' fsck --full --strict 
 + 
 +==== Bootstrap Darkroom ==== 
 + 
 +  :!: Set email for ''user.email'' 
 + 
 +  rm -Rf '/srv/www/media/themes/bootstrap_darkroom/.git' 
 + 
 +  git -C '/srv/www/media/themes/bootstrap_darkroom' init --initial-branch='master' 
 + 
 +  git -C '/srv/www/media/themes/bootstrap_darkroom' add '.' 
 + 
 +  git -C '/srv/www/media/themes/bootstrap_darkroom' config 'user.email' 'espionage724@x' 
 + 
 +  git -C '/srv/www/media/themes/bootstrap_darkroom' commit --message='x' 
 + 
 +  git -C '/srv/www/media/themes/bootstrap_darkroom' remote add 'origin' 'https://github.com/Piwigo/piwigo-bootstrap-darkroom.git' 
 + 
 +  git -C '/srv/www/media/themes/bootstrap_darkroom' pull --depth '1' --recurse-submodules 'origin' 'master' --rebase 
 + 
 +  git -C '/srv/www/media/themes/bootstrap_darkroom' reset --hard 'origin/master' 
 + 
 +  git -C '/srv/www/media/themes/bootstrap_darkroom' gc --aggressive --prune='all' 
 + 
 +  git -C '/srv/www/media/themes/bootstrap_darkroom' fsck --full --strict
  
-  find '/srv/www/media' -type f -print0 | sudo xargs -0 dos2unix -- && sudo chown -R 'wwwrun':'www' '/srv/www/media' && sudo chmod -R '0755' '/srv/www/media'+  exit
  
 ===== MySQL Connection ===== ===== MySQL Connection =====
Line 458: Line 508:
  
   rm -fv ~/'piwigo-files-'*'.tar.gz' ~/'piwigo'*'.sql'   rm -fv ~/'piwigo-files-'*'.tar.gz' ~/'piwigo'*'.sql'
- 
-====== Old Restore ====== 
- 
-===== Client ===== 
- 
-==== Uncompress Database ==== 
- 
-  * This is only needed if restoring an **automated** database backup ((manual doesn't gzip)) 
- 
-  gunzip ~/'Downloads/piwigo-database-'*'.sql.gz' 
  
/srv/www/wiki/data/attic/servers/linux/nginx/piwigo.1757591738.txt.gz · Last modified: by Sean Rhone