Both sides previous revisionPrevious revisionNext revision | Previous revision |
servers:bsd:nginx:piwigo [2025/05/24 05:45] – Sean Rhone | servers:bsd:nginx:piwigo [2025/08/28 00:46] (current) – [Server Block] Sean Rhone |
---|
===== Prerequisites ===== | ===== Prerequisites ===== |
| |
* [[bsd:server:freebsd_14.2|FreeBSD 14.2]] | * [[bsd:server:freebsd_14.3|FreeBSD 14.3]] |
* [[servers:bsd:mariadb|MariaDB]] | |
* [[servers:bsd:nginx_php_php-fpm|nginx + PHP + PHP-FPM]] | * [[servers:bsd:nginx_php_php-fpm|nginx + PHP + PHP-FPM]] |
* [[servers:bsd:nginx:lets_encrypt|Let's Encrypt]] | * [[servers:bsd:nginx:lets_encrypt|Let's Encrypt]] |
| * [[servers:bsd:mariadb|MariaDB]] |
| |
====== Dependencies ====== | ====== Dependencies ====== |
su - | su - |
| |
git clone --branch 'master' --depth '1' --recurse-submodules 'https://github.com/Piwigo/Piwigo.git' '/usr/local/www/media' && chown -R 'www':'www' '/usr/local/www/media' && sync | git clone --branch 'master' --depth '1' --recurse-submodules 'https://github.com/Piwigo/Piwigo.git' '/usr/local/www/media' && chown -R 'www':'www' '/usr/local/www/media' |
| |
git clone --branch 'master' --depth '1' --recurse-submodules 'https://github.com/Piwigo/piwigo-bootstrap-darkroom.git' '/usr/local/www/media/themes/bootstrap_darkroom' && chown -R 'www':'www' '/usr/local/www/media' && sync | git clone --branch 'master' --depth '1' --recurse-submodules 'https://github.com/Piwigo/piwigo-bootstrap-darkroom.git' '/usr/local/www/media/themes/bootstrap_darkroom' && chown -R 'www':'www' '/usr/local/www/media' |
| |
====== Database ====== | ====== Database ====== |
su - | su - |
| |
ee '/usr/local/etc/php-fpm.d/media.conf' && service 'php_fpm' restart | ee '/usr/local/etc/php-fpm.d/media.conf' && service 'php_fpm' reload |
| |
<code> | <code> |
| |
<code> | <code> |
# PHP-FPM | |
location ~ \.(php|phar)(/.*)?$ { | location ~ \.(php|phar)(/.*)?$ { |
fastcgi_split_path_info ^(.+\.(?:php|phar))(/.*)$; | fastcgi_split_path_info ^(.+\.(?:php|phar))(/.*)$; |
server { | server { |
listen '443' 'ssl'; | listen '443' 'ssl'; |
# http2 'on'; | http2 'on'; |
server_name 'media.realmofespionage.xyz'; | server_name 'media.realmofespionage.xyz'; |
root '/usr/local/www/media'; | root '/usr/local/www/media'; |
su - | su - |
| |
ee '/usr/local/www/media/local/config/config.inc.php' && chown 'www':'www' '/usr/local/www/media/local/config/config.inc.php' | su -m 'www' -c "ee '/usr/local/www/media/local/config/config.inc.php'" |
| |
<code> | <code> |
su - | su - |
| |
cd '/usr/local/www' && tar -cvzf '/home/espionage724/piwigo-files-manual-'$(date +%Y-%m-%d)'.tar.gz' 'media' | tar -czf '/home/espionage724/piwigo-files-manual-'$(date +%Y-%m-%d)'.tar.gz' -C '/usr/local/www' 'media' |
| |
===== Database ===== | ===== Database ===== |
**** | **** |
| |
mariadb-dump -u root -p --single-transaction 'piwigo' -r '/home/espionage724/piwigo-database-manual-'$(date +%Y-%m-%d)'.sql' | mariadb-dump -u root -p --single-transaction --quick 'piwigo' -r '/home/espionage724/piwigo-database-manual-'$(date +%Y-%m-%d)'.sql' |
| |
===== scp ===== | ===== scp ===== |
**** | **** |
| |
scp ~/'Downloads/piwigo-files-'*'.tar.gz' ~/'Downloads/piwigo-database-'*'.sql' espionage724@192.168.1.152:~ | scp ~/'Downloads/piwigo-files-'*'.tar.gz' ~/'Downloads/piwigo'*'.sql' espionage724@192.168.1.152:~ |
| |
===== Folder ===== | ===== Folder ===== |
rm -Rf '/usr/local/www/media' | rm -Rf '/usr/local/www/media' |
| |
cd '/usr/local/www' && tar -xvzf '/home/espionage724/piwigo-files-'*'.tar.gz' 'media' && chown -R 'www':'www' '/usr/local/www/media' && cd ~ && sync | tar -xzf '/home/espionage724/piwigo-files-'*'.tar.gz' -C '/usr/local/www' 'media' && chown -R 'www':'www' '/usr/local/www/media' && sync |
| |
===== Database ===== | ===== Database ===== |
| |
mariadb -u 'root' -p 'piwigo' < '/home/espionage724/piwigo-database-manual-'*'.sql' | mariadb -u 'root' -p 'piwigo' < '/home/espionage724/piwigo-database-manual-'*'.sql' |
| |
| mariadb -u 'root' -p 'piwigo' < '/home/espionage724/piwigo.sql' |
| |