User Tools

Site Tools


servers:linux:nginx:friendica

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:friendica [2025/12/21 21:46] – os TW -> Ubuntu (WIP) Sean Rhoneservers:linux:nginx:friendica [2025/12/21 23:56] (current) – [local.config.php] Sean Rhone
Line 21: Line 21:
   * https://wiki.friendi.ca/docs/install#requirements   * https://wiki.friendi.ca/docs/install#requirements
  
-  sudo zypper install php-composer2 php8-curl php-gd php8-gmp php8-pdo php8-mbstring php8-intl php8-mysql php8-zip php8-openssl php8-fileinfo php8-posix +  sudo apt install composer php-curl php-gd php-gmp php-mbstring php-intl php-mysql php-zip
- +
-  sudo apt install +
  
 ====== Download Source ====== ====== Download Source ======
Line 29: Line 27:
   * https://github.com/friendica/friendica/commits/develop/   * https://github.com/friendica/friendica/commits/develop/
  
-  sudo git clone --branch 'develop' --depth '1' --recurse-submodules 'https://github.com/friendica/friendica.git' '/var/www/social' && sudo chown -R 'www-data':'www' '/var/www/social' && sudo chmod -R '0755' '/var/www/social'+  sudo git clone --branch 'develop' --depth '1' --recurse-submodules 'https://github.com/friendica/friendica.git' '/var/www/social' && sudo chown -R 'www-data':'www-data' '/var/www/social' && sudo chmod -R '0755' '/var/www/social'
  
 ===== Addons ===== ===== Addons =====
Line 36: Line 34:
   * :!: Required for ''composer install'' even without any addons enabled   * :!: Required for ''composer install'' even without any addons enabled
  
-  sudo git clone --branch 'develop' --depth '1' --recurse-submodules 'https://github.com/friendica/friendica-addons.git' '/var/www/social/addon' && sudo chown -R 'www-data':'www' '/var/www/social/addon' && sudo chmod -R '0755' '/var/www/social/addon'+  sudo git clone --branch 'develop' --depth '1' --recurse-submodules 'https://github.com/friendica/friendica-addons.git' '/var/www/social/addon' && sudo chown -R 'www-data':'www-data' '/var/www/social/addon' && sudo chmod -R '0755' '/var/www/social/addon'
  
 ====== Environment ====== ====== Environment ======
Line 47: Line 45:
  
   exit   exit
 +
 +===== php-json-ld Fix =====
 +
 +  * https://github.com/friendica/friendica/issues/15340
 +  * https://github.com/digitalbazaar/jsonld.js
 +
 +  nano '/var/www/social/composer.lock'
 +
 +  https://github.com/json-ld/json-ld.org.git
 +
 +<code>
 +            "name": "friendica/json-ld",
 +            "version": "1.1.4",
 +            "source": {
 +                "type": "git",
 +                "url": "https://github.com/digitalbazaar/php-json-ld.git",
 +                "reference": "fe18c3f2ce47f30ace904ef58e7416f933be25e1"</code>
  
 ====== Database ====== ====== Database ======
Line 64: Line 79:
 ===== PHP-FPM Socket ===== ===== PHP-FPM Socket =====
  
-  sudo -e '/etc/php8/fpm/php-fpm.d/social.conf' && sudo systemctl restart 'php-fpm'+  sudo -e '/etc/php/8.4/fpm/pool.d/social.conf' && sudo systemctl restart 'php8.4-fpm'
  
 <code> <code>
Line 71: Line 86:
 ; User/Group ; User/Group
 user = "www-data" user = "www-data"
-group = "www"+group = "www-data"
  
 ; Socket ; Socket
-listen = "/run/php-fpm/social.sock"+listen = "/run/php/social.sock"
 listen.owner = "www-data" listen.owner = "www-data"
-listen.group = "www"+listen.group = "www-data"
 listen.mode = "0662" listen.mode = "0662"
  
Line 84: Line 99:
 pm.process_idle_timeout = "30" pm.process_idle_timeout = "30"
  
-openSUSE php.ini Defaults +Logging
-php_value[session.save_path] = "/var/lib/php8/sessions" +
- +
-; General+
 php_value[log_errors] = "0" php_value[log_errors] = "0"
 php_value[error_reporting] = "~E_ALL" php_value[error_reporting] = "~E_ALL"
 +
 +; General
 php_value[date.timezone] = "America/New_York" php_value[date.timezone] = "America/New_York"
 +
 +; Friendica
 php_value[max_execution_time] = "200" php_value[max_execution_time] = "200"
 php_value[memory_limit] = "512M" php_value[memory_limit] = "512M"
-php_value[post_max_size] = "10M+php_value[post_max_size] = "100M
-php_value[upload_max_filesize] = "10M"+php_value[upload_max_filesize] = "20M"
 php_value[max_file_uploads] = "100" php_value[max_file_uploads] = "100"
 php_value[register_argc_argv] = "On" php_value[register_argc_argv] = "On"
Line 102: Line 118:
 ===== FastCGI ===== ===== FastCGI =====
  
-  * ''social.sock'' +  sudo -e '/etc/nginx/snippets/social.conf'
- +
-  sudo -e '/etc/nginx/default.d/social.conf'+
  
 <code> <code>
-location ~ \.(php|phar)(/.*)?$ { +location '~' '\.(php|phar)(/.*)?$
-    fastcgi_split_path_info ^(.+\.(?:php|phar))(/.*)$; + 
-    fastcgi_intercept_errors on; + fastcgi_split_path_info '^(.+\.(?:php|phar))(/.*)$'
-    fastcgi_index index.php; + fastcgi_intercept_errors 'on'
-    include fastcgi_params; + fastcgi_index 'index.php'
-    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include 'fastcgi_params'
-    fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param 'SCRIPT_FILENAME' '$document_root$fastcgi_script_name'
-    fastcgi_pass unix:/run/php-fpm/social.sock;+ fastcgi_param 'PATH_INFO' '$fastcgi_path_info'
 + fastcgi_param 'HTTPS' 'on'; 
 + 
 + fastcgi_pass 'unix:/run/php/social.sock'; 
 } }
  
Line 121: Line 139:
 ===== Server Block ===== ===== Server Block =====
  
-  sudo -e '/etc/nginx/vhosts.d/social.conf' && sudo systemctl reload 'nginx'+  * :!: ''sites-enabled'' should be done after [[#initialize|initial set-up]] 
 + 
 +  sudo -e '/etc/nginx/sites-available/social.conf'
  
 <code> <code>
 server { server {
-    listen '443' 'ssl'; 
-    http2 'on'; 
-    server_name 'social.realmofespionage.xyz'; 
-    root '/var/www/social'; 
-    index 'index.php'; 
  
-    include '/etc/nginx/default.d/social.conf'; + listen '443' 'ssl'; 
-    include '/etc/nginx/default.d/headers.conf';+ http2 'on'; 
 + server_name 'social.realmofespionage.xyz'; 
 + root '/var/www/social'; 
 + index 'index.php'; 
 + 
 + include '/etc/nginx/snippets/social.conf'; 
 + include '/etc/nginx/snippets/headers.conf'; 
 + 
 + client_max_body_size '10M';
  
-    client_max_body_size '10M';+# access_log '/var/log/nginx/social-access.log'; 
 +# error_log '/var/log/nginx/social-error.log';
  
-#    access_log  /var/log/nginx/social-access.log; + location '/' { 
-#    error_log  /var/log/nginx/social-error.log;+  try_files '$uri' '/index.php?pagename=$uri&$args'; 
 + }
  
-    location / { + location '^~' '/.well-known/' 
-        try_files $uri /index.php?pagename=$uri&$args+  allow 'all'; 
-    }+  rewrite '^' '/index.php?pagename=$uri'
 + }
  
-    location ^/.well-known/ + location '~*' '\.(tpl|md|tgz|log|out)$' 
-        allow all; +  deny 'all'
-        rewrite ^ /index.php?pagename=$uri; + }
-    }+
  
-    location ~\.(tpl|md|tgz|log|out)$ + location '~' '/\.
-        deny all; +  deny 'all'
-    }+ }
  
-    location ~ /\. { 
-        deny all; 
-    } 
 } }
  
 # End</code> # End</code>
 +
 +  sudo ln -s -f '/etc/nginx/sites-available/social.conf' '/etc/nginx/sites-enabled/social.conf' && sudo systemctl reload 'nginx'
  
 ====== Initial Setup ====== ====== Initial Setup ======
Line 164: Line 188:
  
   * :!: Change ''--dbpass'', and ''--admin'' to email   * :!: Change ''--dbpass'', and ''--admin'' to email
 +  * :?: Might be able to use ''--file'' on manually-created ''config/local.config.php'' instead
  
   sudo su 'www-data' -s '/bin/bash'   sudo su 'www-data' -s '/bin/bash'
  
-  cd '/var/www/social' && '/var/www/social/bin/console' autoinstall --dbhost 'localhost' --dbport '3365' --dbuser 'friendica' --dbdata 'friendica' --url 'https://social.realmofespionage.xyz' --dbpass 'x' --admin 'x'+  cd '/var/www/social' && '/var/www/social/bin/console' autoinstall --dbhost 'localhost' --dbport '3365' --dbdata 'friendica' --dbuser 'friendica' --url 'https://social.realmofespionage.xyz' --basepath '/var/www/social' --dbpass 'x' --admin 'x'
  
-===== Website =====+===== Account Create =====
  
-  * https://social.realmofespionage.xyz+  * https://social.realmofespionage.xyz/register
   * :!: Be sure the email matches what was used on the above command   * :!: Be sure the email matches what was used on the above command
  
 ===== User ===== ===== User =====
  
-  * :!: ''x'' is the **nickname** chosen at website registration, lower-case+  * :!: ''x'' is the **nickname** chosen at website registration
  
   sudo su 'www-data' -s '/bin/bash'   sudo su 'www-data' -s '/bin/bash'
  
-  cd '/var/www/social' && '/var/www/social/bin/console' user password x+  cd '/var/www/social' && '/var/www/social/bin/console' user password 'x'
  
 ===== Etc ===== ===== Etc =====
Line 215: Line 240:
  
 <code>{"nav_bg":"#3d8bff","nav_icon_color":"#ffffff","link_color":"#3d8bff","background_color":"#dedede","background_image":"","contentbg_transp":"100","login_bg_image":"","login_bg_color":"#484848"}</code> <code>{"nav_bg":"#3d8bff","nav_icon_color":"#ffffff","link_color":"#3d8bff","background_color":"#dedede","background_image":"","contentbg_transp":"100","login_bg_image":"","login_bg_color":"#484848"}</code>
 +
 +===== local.config.php =====
 +
 +  sudo -u 'www-data' -e '/var/www/social/config/local.config.php'
 +
 +<code>
 +<?php
 +
 +return [
 +        'database' => [
 +                'hostname' => 'localhost',
 +                'username' => 'friendica',
 +                'password' => 'x',
 +                'database' => 'friendica',
 +                'charset' => 'utf8mb4',
 +        ],
 +
 +        'config' => [
 +                'php_path' => '/usr/bin/php',
 +                'admin_email' => 'espionage724@x',
 +                'sitename' => 'Friendica Social Network',
 +                'register_policy' => \Friendica\Module\Register::OPEN,
 +                'max_import_size' => 200000,
 +        ],
 +        'system' => [
 +                'url' => 'https://social.realmofespionage.xyz',
 +                'basepath' => '/var/www/social',
 +                'default_timezone' => 'America/New_York',
 +                'language' => 'en',
 +        ],
 +];
 +
 +// End</code>
 +
 +====== Scripts ======
 +
 +===== Git Fix =====
 +
 +  * :!: Set email for ''user.email''
 +
 +  sudo mkdir -p '/etc/nginx/scripts/social' && sudo -e '/etc/nginx/scripts/social/git-fix.sh' && sudo chmod '0500' '/etc/nginx/scripts/social/git-fix.sh' && sudo chown 'www-data':'www-data' '/etc/nginx/scripts/social/git-fix.sh'
 +
 +<code>
 +TODO</code>
 +
 +  sudo -u 'www-data' '/etc/nginx/scripts/social/git-fix.sh'
  
 ====== Services ====== ====== Services ======
Line 488: Line 559:
 **** ****
  
-  sudo tar -xzf ~/'friendica-files-'*'.tar.gz' -C '/var/www' 'social' && sudo chown -R 'www-data':'www' '/var/www/social' && sudo chmod -R '0755' '/var/www/social'+  sudo tar -xzf ~/'friendica-files-'*'.tar.gz' -C '/var/www' 'social' && sudo chown -R 'www-data':'www-data' '/var/www/social' && sudo chmod -R '0755' '/var/www/social'
  
 ===== Git Fix ===== ===== Git Fix =====
/var/www/wiki/data/attic/servers/linux/nginx/friendica.1766371611.txt.gz · Last modified: by Sean Rhone · Currently locked by: Sean Rhone

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki