Both sides previous revisionPrevious revisionNext revision | Previous revision |
servers:linux:nginx:piwigo [2025/09/11 08:17] – Sean Rhone | servers:linux:nginx:piwigo [2025/10/16 23:22] (current) – [Database] Sean Rhone |
---|
* 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 ====== |
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 ====== |
| |
; 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" |
| |
# 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 ===== |
| |
# 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 ====== |
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 ===== |