servers:nginx:friendica
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
servers:nginx:friendica [2019/06/29 00:43] – [Service] Sean Rhone | servers:nginx:friendica [2019/12/15 10:32] – [PHP-FPM Socket] Sean Rhone | ||
---|---|---|---|
Line 7: | Line 7: | ||
===== Prerequisites ===== | ===== Prerequisites ===== | ||
- | * [[distros:fedora_server|Fedora | + | * [[distros:ubuntu_server|Ubuntu |
- | * [[servers: | + | * [[servers: |
- | * [[servers: | + | * [[servers: |
- | * [[servers: | + | * [[servers: |
====== Download Source ====== | ====== Download Source ====== | ||
Line 16: | Line 16: | ||
* :!: '' | * :!: '' | ||
- | sudo rm -Rf '/ | + | sudo rm -Rf '/ |
- | + | ||
- | ===== SELinux ===== | + | |
- | + | ||
- | sudo semanage fcontext | + | |
- | + | ||
- | sudo semanage fcontext --add --type | + | |
- | + | ||
- | sudo restorecon -R -v '/ | + | |
====== PHP Dependencies ====== | ====== PHP Dependencies ====== | ||
Line 30: | Line 22: | ||
**** | **** | ||
- | cd '/ | + | cd '/ |
====== Database ====== | ====== Database ====== | ||
- | mysql --user=' | + | |
CREATE DATABASE friendica; | CREATE DATABASE friendica; | ||
Line 41: | Line 33: | ||
FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
+ | |||
+ | EXIT | ||
====== nginx + PHP-FPM Configuration ====== | ====== nginx + PHP-FPM Configuration ====== | ||
Line 46: | Line 40: | ||
===== PHP-FPM Socket ===== | ===== PHP-FPM Socket ===== | ||
- | sudo -e '/ | + | sudo -e '/ |
< | < | ||
[social] | [social] | ||
- | user = nginx | + | user = www-data |
- | group = nginx | + | group = www-data |
- | listen = /run/php-fpm/ | + | listen = / |
- | listen.owner = nginx | + | listen.owner = www-data |
- | listen.group = nginx | + | listen.group = www-data |
listen.allowed_clients = 127.0.0.1 | listen.allowed_clients = 127.0.0.1 | ||
Line 73: | Line 67: | ||
php_value[max_file_uploads] = " | php_value[max_file_uploads] = " | ||
- | php_value[session.save_handler] = files | + | php_value[session.save_handler] = "files" |
- | php_value[session.save_path] = / | + | php_value[session.save_path] = "/ |
- | php_value[soap.wsdl_cache_dir] = / | + | php_value[soap.wsdl_cache_dir] = "/ |
- | php_value[opcache.file_cache] = / | + | php_value[opcache.file_cache] = "/ |
===== FastCGI ===== | ===== FastCGI ===== | ||
- | sudo -e '/ | + | sudo -e '/ |
< | < | ||
Line 92: | Line 86: | ||
fastcgi_param SCRIPT_FILENAME | fastcgi_param SCRIPT_FILENAME | ||
fastcgi_param PATH_INFO $fastcgi_path_info; | fastcgi_param PATH_INFO $fastcgi_path_info; | ||
- | fastcgi_pass unix:/ | + | fastcgi_pass unix:/ |
}</ | }</ | ||
===== Server Block ===== | ===== Server Block ===== | ||
- | sudo -e '/ | + | sudo -e '/ |
< | < | ||
Line 106: | Line 100: | ||
index ' | index ' | ||
- | include '/ | + | include '/ |
- | include '/ | + | include '/ |
client_max_body_size ' | client_max_body_size ' | ||
Line 133: | Line 127: | ||
} | } | ||
}</ | }</ | ||
+ | |||
+ | ==== Enable ==== | ||
+ | |||
+ | **** | ||
+ | |||
+ | sudo rm -f '/ | ||
====== Initial Setup ====== | ====== Initial Setup ====== | ||
Line 148: | Line 148: | ||
< | < | ||
[Service] | [Service] | ||
- | User=nginx | + | User=www-data |
- | Group=nginx | + | Group=www-data |
Type=oneshot | Type=oneshot | ||
WorkingDirectory=/ | WorkingDirectory=/ | ||
ExecStart='/ | ExecStart='/ | ||
- | ExecStartPost=' | + | ExecStartPost='/ |
==== Timer ==== | ==== Timer ==== | ||
Line 182: | Line 182: | ||
< | < | ||
[Service] | [Service] | ||
- | User=nginx | + | User=www-data |
- | Group=nginx | + | Group=www-data |
Type=oneshot | Type=oneshot | ||
WorkingDirectory=/ | WorkingDirectory=/ | ||
Line 190: | Line 190: | ||
ExecStart='/ | ExecStart='/ | ||
ExecStart='/ | ExecStart='/ | ||
- | ExecStartPost=' | + | ExecStartPost='/ |
==== Timer ==== | ==== Timer ==== | ||
Line 219: | Line 219: | ||
< | < | ||
[Service] | [Service] | ||
- | User=nginx | + | User=www-data |
- | Group=nginx | + | Group=www-data |
Type=oneshot | Type=oneshot | ||
ExecStart='/ | ExecStart='/ | ||
Line 226: | Line 226: | ||
ExecStart='/ | ExecStart='/ | ||
ExecStart='/ | ExecStart='/ | ||
- | ExecStartPost=' | + | ExecStartPost='/ |
==== Timer ==== | ==== Timer ==== | ||
Line 259: | Line 259: | ||
Type=oneshot | Type=oneshot | ||
WorkingDirectory=/ | WorkingDirectory=/ | ||
- | ExecStart=' | + | ExecStart='/ |
- | ExecStartPost=' | + | ExecStartPost='/ |
=== Timer === | === Timer === | ||
Line 299: | Line 299: | ||
WorkingDirectory=/ | WorkingDirectory=/ | ||
ExecStartPre='/ | ExecStartPre='/ | ||
- | ExecStart=' | + | ExecStart='/ |
- | ExecStart=' | + | ExecStart='/ |
- | ExecStartPost=' | + | ExecStartPost='/ |
=== Timer === | === Timer === | ||
Line 331: | Line 331: | ||
**** | **** | ||
- | sudo systemctl stop nginx php-fpm | + | sudo systemctl stop nginx php7.2-fpm |
==== Backup Folder ==== | ==== Backup Folder ==== | ||
Line 343: | Line 343: | ||
**** | **** | ||
- | sudo -u ' | + | sudo mysqldump --defaults-extra-file='/ |
==== Start Services ==== | ==== Start Services ==== | ||
Line 349: | Line 349: | ||
**** | **** | ||
- | sudo systemctl start nginx php-fpm | + | sudo systemctl start nginx php7.2-fpm |
===== Client ===== | ===== Client ===== | ||
Line 387: | Line 387: | ||
**** | **** | ||
- | sudo systemctl stop nginx php-fpm | + | sudo systemctl stop nginx php7.2-fpm |
==== Remove Previous Folder ==== | ==== Remove Previous Folder ==== | ||
Line 399: | Line 399: | ||
**** | **** | ||
- | cd '/ | + | cd '/ |
- | + | ||
- | ==== SELinux ==== | + | |
- | + | ||
- | sudo semanage fcontext --deleteall "/ | + | |
- | + | ||
- | sudo semanage fcontext --add --type ' | + | |
- | + | ||
- | sudo restorecon -R -v '/ | + | |
==== Drop Previous Database ==== | ==== Drop Previous Database ==== | ||
- | mysql --user=' | + | |
DROP DATABASE friendica; | DROP DATABASE friendica; | ||
FLUSH TABLES; | FLUSH TABLES; | ||
+ | |||
+ | EXIT | ||
==== Re-create Databases ==== | ==== Re-create Databases ==== | ||
- | mysql --user=' | + | |
CREATE DATABASE friendica; | CREATE DATABASE friendica; | ||
+ | |||
+ | EXIT | ||
==== Restore Database ==== | ==== Restore Database ==== | ||
Line 427: | Line 423: | ||
**** | **** | ||
- | mysql --user=' | + | |
==== Reapply Permissions ==== | ==== Reapply Permissions ==== | ||
- | mysql --user=' | + | |
GRANT ALL PRIVILEGES ON friendica.* to ' | GRANT ALL PRIVILEGES ON friendica.* to ' | ||
FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
+ | |||
+ | EXIT | ||
==== Start Services ==== | ==== Start Services ==== | ||
Line 441: | Line 439: | ||
**** | **** | ||
- | sudo systemctl start nginx php-fpm | + | sudo systemctl start nginx php7.2-fpm |
==== Remove Backups ==== | ==== Remove Backups ==== |
/var/www/wiki/data/pages/servers/nginx/friendica.txt · Last modified: 2024/02/01 08:29 by Sean Rhone