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/12/15 10:32] – [PHP-FPM Socket] Sean Rhone | servers:nginx:friendica [2023/09/12 20:02] – [PHP Dependencies] Sean Rhone | ||
---|---|---|---|
Line 7: | Line 7: | ||
===== Prerequisites ===== | ===== Prerequisites ===== | ||
- | * [[distros:ubuntu_server|Ubuntu | + | * [[distros:fedora_server|Fedora |
* [[servers: | * [[servers: | ||
* [[servers: | * [[servers: | ||
* [[servers: | * [[servers: | ||
+ | |||
+ | ====== Dependencies ====== | ||
+ | |||
+ | * https:// | ||
+ | |||
+ | sudo dnf install php-gd php-pdo php-mbstring php-mysqlnd php-xml php-pecl-zip php-process php-gmp php-pecl-xdebug3 | ||
====== Download Source ====== | ====== Download Source ====== | ||
- | | + | **** |
- | | + | sudo git clone --branch 'develop' --depth ' |
====== PHP Dependencies ====== | ====== PHP Dependencies ====== | ||
- | **** | + | |
+ | |||
+ | sudo su ' | ||
- | cd '/ | + | cd '/ |
====== Database ====== | ====== Database ====== | ||
- | sudo mysql | + | sudo mariadb |
CREATE DATABASE friendica; | CREATE DATABASE friendica; | ||
Line 40: | Line 48: | ||
===== PHP-FPM Socket ===== | ===== PHP-FPM Socket ===== | ||
- | sudo -e '/ | + | sudo -e '/ |
< | < | ||
[social] | [social] | ||
- | user = www-data | ||
- | group = www-data | ||
- | listen = / | + | ; User/ |
- | listen.owner = www-data | + | user = nginx |
- | listen.group = www-data | + | group = nginx |
+ | |||
+ | ; Socket | ||
+ | listen = /run/php-fpm/ | ||
+ | listen.acl_users | ||
listen.allowed_clients = 127.0.0.1 | listen.allowed_clients = 127.0.0.1 | ||
- | pm = dynamic | + | ; Process Management |
- | pm.max_children = 8 | + | pm = ondemand |
- | pm.start_servers | + | pm.max_children = 4 |
- | pm.min_spare_servers = 2 | + | pm.process_idle_timeout |
- | pm.max_spare_servers = 4 | + | |
- | php_value[date.timezone] = "America/ | + | ; Fedora php.ini Defaults |
- | php_value[upload_tmp_dir] = "/tmp" | + | php_value[session.save_handler] = "files" |
+ | php_value[session.save_path] = "/var/ | ||
+ | ; General | ||
+ | php_value[date.timezone] = " | ||
php_value[max_execution_time] = " | php_value[max_execution_time] = " | ||
php_value[memory_limit] = " | php_value[memory_limit] = " | ||
Line 66: | Line 78: | ||
php_value[upload_max_filesize] = " | php_value[upload_max_filesize] = " | ||
php_value[max_file_uploads] = " | php_value[max_file_uploads] = " | ||
+ | php_value[register_argc_argv] = " | ||
+ | php_value[upload_tmp_dir] = "/ | ||
- | php_value[session.save_handler] = " | + | ; End</ |
- | php_value[session.save_path] = "/ | + | |
- | php_value[soap.wsdl_cache_dir] = "/ | + | |
- | php_value[opcache.file_cache] = "/ | + | |
===== FastCGI ===== | ===== FastCGI ===== | ||
- | sudo -e '/ | + | sudo -e '/ |
< | < | ||
Line 80: | Line 91: | ||
location ~ \.(php|phar)(/ | location ~ \.(php|phar)(/ | ||
fastcgi_split_path_info ^(.+\.(?: | fastcgi_split_path_info ^(.+\.(?: | ||
- | |||
fastcgi_intercept_errors on; | fastcgi_intercept_errors on; | ||
fastcgi_index index.php; | fastcgi_index index.php; | ||
Line 86: | Line 96: | ||
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:/ |
+ | }</ | ||
+ | |||
+ | ==== Test ==== | ||
+ | |||
+ | < | ||
+ | # PHP-FPM | ||
+ | location ~* \.php$ { | ||
+ | # fastcgi_intercept_errors on; | ||
+ | # fastcgi_param PATH_INFO $fastcgi_path_info; | ||
+ | fastcgi_pass unix:/ | ||
+ | fastcgi_buffers 8 16k; | ||
+ | fastcgi_buffer_size 32k; | ||
+ | fastcgi_connect_timeout 60; | ||
+ | fastcgi_send_timeout 300; | ||
+ | fastcgi_read_timeout 300; | ||
+ | fastcgi_split_path_info ^(.+? | ||
+ | try_files $uri =404; | ||
+ | fastcgi_index index.php; | ||
+ | include fastcgi_params; | ||
+ | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
}</ | }</ | ||
===== Server Block ===== | ===== Server Block ===== | ||
- | sudo -e '/ | + | |
+ | |||
+ | | ||
< | < | ||
Line 100: | Line 132: | ||
index ' | index ' | ||
- | include '/ | + | include '/ |
- | include '/ | + | include '/ |
client_max_body_size ' | client_max_body_size ' | ||
- | | + | # |
# access_log | # access_log | ||
Line 128: | Line 160: | ||
}</ | }</ | ||
- | ==== Enable | + | ====== Initial Setup ====== |
- | **** | + | ===== Initialize ===== |
- | | + | |
- | ====== Initial Setup ====== | + | sudo su ' |
+ | |||
+ | cd '/ | ||
+ | |||
+ | ===== Website | ||
* https:// | * https:// | ||
+ | * :!: Be sure the email matches what was used on the above command | ||
+ | |||
+ | ===== User ===== | ||
+ | |||
+ | * :!: '' | ||
+ | |||
+ | sudo su ' | ||
+ | |||
+ | cd '/ | ||
+ | |||
+ | ====== Settings ====== | ||
+ | |||
+ | ===== frio Theme ===== | ||
+ | |||
+ | * Navigation bar background color: '' | ||
+ | * Navigation bar icon color: '' | ||
+ | * Link color: '' | ||
+ | * Set the background color: '' | ||
+ | * Login page background color: '' | ||
+ | |||
+ | * Copy or paste schemestring: | ||
+ | |||
+ | < | ||
====== Services ====== | ====== Services ====== | ||
Line 148: | Line 207: | ||
< | < | ||
[Service] | [Service] | ||
- | User=www-data | + | User=nginx |
- | Group=www-data | + | Group=nginx |
Type=oneshot | Type=oneshot | ||
WorkingDirectory=/ | WorkingDirectory=/ | ||
ExecStart='/ | ExecStart='/ | ||
- | ExecStartPost='/ | + | ExecStartPost=' |
==== Timer ==== | ==== Timer ==== | ||
Line 173: | Line 232: | ||
[Install] | [Install] | ||
WantedBy=timers.target</ | WantedBy=timers.target</ | ||
+ | |||
+ | ==== SELinux Test ==== | ||
+ | |||
+ | **** | ||
+ | |||
+ | sudo semanage fcontext --add --type ' | ||
+ | |||
+ | sudo semanage fcontext --add --type ' | ||
===== Updater ===== | ===== Updater ===== | ||
Line 182: | Line 249: | ||
< | < | ||
[Service] | [Service] | ||
- | User=www-data | + | User=nginx |
- | Group=www-data | + | Group=nginx |
Type=oneshot | Type=oneshot | ||
WorkingDirectory=/ | WorkingDirectory=/ | ||
Environment=" | Environment=" | ||
- | ExecStart='/ | + | ExecStart='/ |
- | ExecStart='/ | + | ExecStart='/ |
- | ExecStart='/ | + | ExecStart='/ |
- | ExecStartPost='/ | + | ExecStartPost=' |
==== Timer ==== | ==== Timer ==== | ||
Line 219: | Line 286: | ||
< | < | ||
[Service] | [Service] | ||
- | User=www-data | + | User=nginx |
- | Group=www-data | + | Group=nginx |
Type=oneshot | Type=oneshot | ||
ExecStart='/ | ExecStart='/ | ||
Line 226: | Line 293: | ||
ExecStart='/ | ExecStart='/ | ||
ExecStart='/ | ExecStart='/ | ||
- | ExecStartPost='/ | + | ExecStartPost=' |
==== Timer ==== | ==== Timer ==== | ||
Line 259: | Line 326: | ||
Type=oneshot | Type=oneshot | ||
WorkingDirectory=/ | WorkingDirectory=/ | ||
- | ExecStart='/ | + | ExecStart=' |
- | ExecStartPost='/ | + | ExecStartPost=' |
=== Timer === | === Timer === | ||
Line 283: | Line 350: | ||
=== Database Auth === | === Database Auth === | ||
- | sudo -u ' | + | sudo mkdir -p '/var/lib/mysql/auth' |
< | < | ||
- | [mysqldump] | + | [mariadb-dump] |
user=friendica | user=friendica | ||
password=x</ | password=x</ | ||
Line 298: | Line 365: | ||
Type=oneshot | Type=oneshot | ||
WorkingDirectory=/ | WorkingDirectory=/ | ||
- | ExecStartPre='/ | + | ExecStartPre='/ |
- | ExecStart='/ | + | ExecStart=' |
- | ExecStart='/ | + | ExecStart=' |
- | ExecStartPost='/ | + | ExecStartPost=' |
=== Timer === | === Timer === | ||
Line 331: | Line 398: | ||
**** | **** | ||
- | sudo systemctl stop nginx php7.2-fpm | + | sudo systemctl stop nginx php-fpm |
==== Backup Folder ==== | ==== Backup Folder ==== | ||
Line 343: | Line 410: | ||
**** | **** | ||
- | sudo mysqldump | + | sudo mariadb-dump |
==== Start Services ==== | ==== Start Services ==== | ||
Line 349: | Line 416: | ||
**** | **** | ||
- | sudo systemctl start nginx php7.2-fpm | + | sudo systemctl start nginx php-fpm |
===== Client ===== | ===== Client ===== | ||
Line 357: | Line 424: | ||
**** | **** | ||
- | scp espionage724@192.168.1.153: | + | scp espionage724@192.168.1.152: |
====== Restore ====== | ====== Restore ====== | ||
Line 373: | Line 440: | ||
**** | **** | ||
- | scp ~/' | + | scp ~/' |
==== Remove Files ==== | ==== Remove Files ==== | ||
Line 387: | Line 454: | ||
**** | **** | ||
- | sudo systemctl stop nginx php7.2-fpm | + | sudo systemctl stop nginx php-fpm |
==== Remove Previous Folder ==== | ==== Remove Previous Folder ==== | ||
Line 395: | Line 462: | ||
sudo rm -Rf '/ | sudo rm -Rf '/ | ||
- | ==== Restore | + | ==== Restore |
**** | **** | ||
- | cd '/ | + | cd '/ |
==== Drop Previous Database ==== | ==== Drop Previous Database ==== | ||
- | sudo mysql | + | sudo mariadb |
DROP DATABASE friendica; | DROP DATABASE friendica; | ||
Line 413: | Line 480: | ||
==== Re-create Databases ==== | ==== Re-create Databases ==== | ||
- | sudo mysql | + | sudo mariadb |
CREATE DATABASE friendica; | CREATE DATABASE friendica; | ||
Line 423: | Line 490: | ||
**** | **** | ||
- | sudo mysql ' | + | sudo mariadb |
==== Reapply Permissions ==== | ==== Reapply Permissions ==== | ||
- | sudo mysql | + | sudo mariadb |
GRANT ALL PRIVILEGES ON friendica.* to ' | GRANT ALL PRIVILEGES ON friendica.* to ' | ||
Line 439: | Line 506: | ||
**** | **** | ||
- | sudo systemctl start nginx php7.2-fpm | + | sudo systemctl start nginx php-fpm |
==== Remove Backups ==== | ==== Remove Backups ==== | ||
- | * Verify that friendica | + | * Verify that Friendica |
rm ~/' | rm ~/' | ||
+ |
/var/www/wiki/data/pages/servers/nginx/friendica.txt · Last modified: 2024/02/01 08:29 by Sean Rhone