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/09/11 18:19] Sean Rhoneservers:linux:nginx:friendica [2025/12/22 01:55] (current) Sean Rhone
Line 4: Line 4:
   * [[information:realm_of_espionage|Realm of Espionage]]   * [[information:realm_of_espionage|Realm of Espionage]]
   * https://social.realmofespionage.xyz   * https://social.realmofespionage.xyz
 +
 +===== Resources =====
 +
 +  * https://wiki.friendi.ca/docs/bbcode
  
 ===== Prerequisites ===== ===== Prerequisites =====
  
-  * [[linux:distros:server:opensuse_tumbleweed_server|openSUSE Tumbleweed (Server)]]+  * [[linux:distros:server:ubuntu_server|Ubuntu Server]]
   * [[servers:linux:nginx_php_php-fpm|nginx + PHP + PHP-FPM]]   * [[servers:linux:nginx_php_php-fpm|nginx + PHP + PHP-FPM]]
   * [[servers:linux:nginx:lets_encrypt|Certbot (Let's Encrypt)]]   * [[servers:linux:nginx:lets_encrypt|Certbot (Let's Encrypt)]]
Line 17: 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-posix+  sudo apt install composer php-curl php-gd php-gmp php-mbstring php-intl php-mysql php-zip
  
 ====== Download Source ====== ====== Download Source ======
Line 23: 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' '/srv/www/social' && sudo chown -R 'wwwrun':'www' '/srv/www/social' && sudo chmod -R '0755' '/srv/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 =====
  
   * https://github.com/friendica/friendica-addons/commits/develop/   * https://github.com/friendica/friendica-addons/commits/develop/
-  * Required for ''composer install'' even without addons actively used+  * :!: 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' '/srv/www/social/addon' && sudo chown -R 'wwwrun':'www' '/srv/www/social/addon' && sudo chmod -R '0755' '/srv/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 36: Line 40:
 ===== Composer ===== ===== Composer =====
  
-  sudo su 'wwwrun' -s '/bin/bash'+  sudo su 'www-data' -s '/bin/bash'
  
-  cd '/tmp' && '/usr/bin/composer' --working-dir='/srv/www/social' --no-cache install --no-dev+  cd '/tmp' && '/usr/bin/composer' --working-dir='/var/www/social' --no-cache install --no-dev
  
   exit   exit
 +
 +===== php-json-ld Fix =====
 +
 +  * 2025/12/22: ''git.friendi.ca'' requires authentication and fails during ''composer install''
 +  * [[https://github.com/friendica/friendica/issues/15340|#15340]]
 +
 +  nano '/var/www/social/composer.lock'
 +
 +<code>
 +                "url": "https://github.com/digitalbazaar/php-json-ld.git",
 +                "reference": "fe18c3f2ce47f30ace904ef58e7416f933be25e1"</code>
 +
 +  friendica/json-ld
 +
 +<code>
 +            "name": "friendica/json-ld",
 +            "version": "1.1.4",
 +            "source": {
 +                "type": "git",
 +                "url": "https://github.com/digitalbazaar/php-json-ld.git",
 +                "reference": "fe18c3f2ce47f30ace904ef58e7416f933be25e1"
 +            },</code>
 +
 +==== sed Test ====
 +
 +  sudo su 'www-data' -s '/bin/bash'
 +
 +  sed -i 's|https://git.friendi.ca/friendica/php-json-ld|https://github.com/digitalbazaar/php-json-ld.git|g' '/var/www/social/composer.lock'
 +
 +  sed -i 's/1f33c8766b5cfbecfbc2122238873debeed35fb6/fe18c3f2ce47f30ace904ef58e7416f933be25e1/g' '/var/www/social/composer.lock'
  
 ====== Database ====== ====== Database ======
Line 52: Line 86:
   GRANT ALL PRIVILEGES ON friendica.* to 'friendica'@'localhost';   GRANT ALL PRIVILEGES ON friendica.* to 'friendica'@'localhost';
  
-  FLUSH PRIVILEGES; +  FLUSH PRIVILEGES;EXIT;
- +
-  EXIT+
  
 ====== nginx + PHP-FPM Configuration ====== ====== nginx + PHP-FPM Configuration ======
Line 60: Line 92:
 ===== 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 66: Line 98:
  
 ; User/Group ; User/Group
-user = "wwwrun+user = "www-data
-group = "www"+group = "www-data"
  
 ; Socket ; Socket
-listen = "/run/php-fpm/social.sock" +listen = "/run/php/social.sock" 
-listen.owner = "wwwrun+listen.owner = "www-data
-listen.group = "www"+listen.group = "www-data"
 listen.mode = "0662" listen.mode = "0662"
  
Line 80: Line 112:
 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"
Line 98: Line 131:
 ===== 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 117: Line 152:
 ===== Server Block ===== ===== Server Block =====
  
-  sudo -e '/etc/nginx/vhosts.d/social.conf' && sudo systemctl reload 'nginx'+  * :!: ''sites-enabled'' should be done after [[#initialize]] 
 + 
 +  sudo -e '/etc/nginx/sites-available/social.conf'
  
 <code> <code>
 server { server {
-    listen '443' 'ssl'; 
-    http2 'on'; 
-    server_name 'social.realmofespionage.xyz'; 
-    root '/srv/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';
  
-    client_max_body_size '10M';+ include '/etc/nginx/snippets/social.conf'; 
 + include '/etc/nginx/snippets/headers.conf';
  
-#    access_log  /var/log/nginx/social-access.log; + client_max_body_size '10M';
-#    error_log  /var/log/nginx/social-error.log;+
  
-    location +# access_log '/var/log/nginx/social-access.log'
-        try_files $uri /index.php?pagename=$uri&$args+# error_log '/var/log/nginx/social-error.log';
-    }+
  
-    location ^~ /.well-known/ { + location '/
-        allow all; +  try_files '$uri' '/index.php?pagename=$uri&$args'
-        rewrite ^ /index.php?pagename=$uri; + }
-    }+
  
-    location ~* \.(tpl|md|tgz|log|out)$ { + location '^~' '/.well-known/'
-        deny all; +  allow 'all'; 
-    }+  rewrite '^' '/index.php?pagename=$uri'; 
 + } 
 + 
 + location '~*' '\.(tpl|md|tgz|log|out)$' { 
 +  deny 'all'; 
 + } 
 + 
 + location '~' '/\.' 
 +  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 ======
  
 ===== Initialize ===== ===== Initialize =====
 +
 +  * https://wiki.friendi.ca/docs/install#option_brun_the_automatic_install_script
  
   * :!: Change ''--dbpass'', and ''--admin'' to email   * :!: Change ''--dbpass'', and ''--admin'' to email
 +  * :?: Might be able to use ''--file'' on manually-created [[#localconfigphp|local.config.php]] instead
  
-  sudo su 'wwwrun' -s '/bin/bash'+  sudo su 'www-data' -s '/bin/bash'
  
-  cd '/srv/www/social' && '/srv/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 'wwwrun' -s '/bin/bash'+  sudo su 'www-data' -s '/bin/bash'
  
-  cd '/srv/www/social' && '/srv/www/social/bin/console' user password x+  cd '/var/www/social' && '/var/www/social/bin/console' user password 'x
 + 
 +===== Disable Registration ===== 
 + 
 +  sudo su 'www-data' -s '/bin/bash' 
 + 
 +  cd '/var/www/social' && '/usr/bin/php' '/var/www/social/bin/console.php' config 'config' 'register_policy' '0'
  
 ===== Etc ===== ===== Etc =====
  
-  cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' -h+  cd '/var/www/social' && '/usr/bin/php' '/var/www/social/bin/console.php' -h
  
-  cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' worker+  cd '/var/www/social' && '/usr/bin/php' '/var/www/social/bin/console.php' worker
  
-  cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' dbstructure update --force+  cd '/var/www/social' && '/usr/bin/php' '/var/www/social/bin/console.php' dbstructure update --force
  
-  cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' dbstructure drop --execute+  cd '/var/www/social' && '/usr/bin/php' '/var/www/social/bin/console.php' dbstructure drop --execute
  
-  cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' postupdate+  cd '/var/www/social' && '/usr/bin/php' '/var/www/social/bin/console.php' postupdate
  
-  cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' cache clear+  cd '/var/www/social' && '/usr/bin/php' '/var/www/social/bin/console.php' cache clear
  
-  cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' clearavatarcache+  cd '/var/www/social' && '/usr/bin/php' '/var/www/social/bin/console.php' clearavatarcache
  
-  nano '/srv/www/social/config/local.config.php'+  cd '/var/www/social' && '/usr/bin/php' '/var/www/social/bin/console.php' config 'config' 'info' 'https://wiki.realmofespionage.xyz/servers:linux:nginx:friendica' 
 + 
 +  exit
  
 ====== Settings ====== ====== Settings ======
Line 209: Line 261:
  
 <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 =====
 +
 +  * :!: Change database ''password'' and config ''admin_email''
 +
 +  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' => 'RoE | Social',
 +                'register_policy' => \Friendica\Module\Register::CLOSED,
 +                '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 **both** ''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>
 +#!/bin/bash
 +
 +'/usr/bin/rm' -Rf '/var/www/social/.git'
 +'/usr/bin/git' -C '/var/www/social' init --initial-branch='develop'
 +'/usr/bin/git' -C '/var/www/social' add '.'
 +
 +########################################
 +'/usr/bin/git' -C '/var/www/social' config 'user.email' 'espionage724@x'
 +########################################
 +
 +'/usr/bin/git' -C '/var/www/social' commit --message='x'
 +
 +'/usr/bin/git' -C '/var/www/social' remote add 'origin' 'https://github.com/friendica/friendica.git'
 +'/usr/bin/git' -C '/var/www/social' pull --depth '1' --recurse-submodules 'origin' 'develop' --rebase
 +
 +'/usr/bin/git' -C '/var/www/social' reset --hard 'origin/develop'
 +'/usr/bin/git' -C '/var/www/social' gc --aggressive --prune='all'
 +'/usr/bin/git' -C '/var/www/social' fsck --full --strict
 +
 +'/usr/bin/rm' -Rf '/var/www/social/addon/.git'
 +'/usr/bin/git' -C '/var/www/social/addon' init --initial-branch='develop'
 +'/usr/bin/git' -C '/var/www/social/addon' add '.'
 +
 +########################################
 +'/usr/bin/git' -C '/var/www/social/addon' config 'user.email' 'espionage724@x'
 +########################################
 +
 +'/usr/bin/git' -C '/var/www/social/addon' commit --message='x'
 +
 +'/usr/bin/git' -C '/var/www/social/addon' remote add 'origin' 'https://github.com/friendica/friendica-addons.git'
 +'/usr/bin/git' -C '/var/www/social/addon' pull --depth '1' --recurse-submodules 'origin' 'develop' --rebase
 +
 +'/usr/bin/git' -C '/var/www/social/addon' reset --hard 'origin/develop'
 +'/usr/bin/git' -C '/var/www/social/addon' gc --aggressive --prune='all'
 +'/usr/bin/git' -C '/var/www/social/addon' fsck --full --strict
 +
 +# End</code>
 +
 +  sudo -u 'www-data' '/etc/nginx/scripts/social/git-fix.sh'
 +
 +===== Settings Fix =====
 +
 +  sudo mkdir -p '/etc/nginx/scripts/social' && sudo -e '/etc/nginx/scripts/social/settings-fix.sh' && sudo chmod '0500' '/etc/nginx/scripts/social/settings-fix.sh' && sudo chown 'www-data':'www-data' '/etc/nginx/scripts/social/settings-fix.sh'
 +
 +<code>
 +#!/bin/bash
 +
 +cd '/var/www/social'
 +
 +'/usr/bin/php' '/var/www/social/bin/console.php' worker
 +
 +'/usr/bin/php' '/var/www/social/bin/console.php' dbstructure update --force
 +'/usr/bin/php' '/var/www/social/bin/console.php' dbstructure drop --execute
 +'/usr/bin/php' '/var/www/social/bin/console.php' postupdate
 +
 +'/usr/bin/php' '/var/www/social/bin/console.php' cache clear
 +'/usr/bin/php' '/var/www/social/bin/console.php' clearavatarcache
 +
 +'/usr/bin/php' '/var/www/social/bin/console.php' config 'config' 'info' 'https://wiki.realmofespionage.xyz/servers:linux:nginx:friendica'
 +
 +# End</code>
 +
 +  sudo -u 'www-data' '/etc/nginx/scripts/social/settings-fix.sh'
  
 ====== Services ====== ====== Services ======
Line 220: Line 380:
 <code> <code>
 [Service] [Service]
-User=wwwrun +User=www-data 
-Group=www+Group=www-data
 Type=oneshot Type=oneshot
  
-WorkingDirectory=/srv/www/social+WorkingDirectory=/var/www/social
  
-ExecStart='/usr/bin/php' '/srv/www/social/bin/console.php' worker +ExecStart='/usr/bin/php' '/var/www/social/bin/console.php' worker
- +
-ExecStartPost='/usr/bin/sync'+
  
 # End</code> # End</code>
Line 234: Line 392:
 ==== Timer ==== ==== Timer ====
  
-  * Every 12 hours+  * Every 10 minutes ([[https://wiki.friendi.ca/docs/install#required_background_tasks|info]])
  
   sudo -e '/etc/systemd/system/social-d.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'social-d.timer' --now && sudo systemctl start 'social-d' && sudo systemctl status 'social-d' -l   sudo -e '/etc/systemd/system/social-d.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'social-d.timer' --now && sudo systemctl start 'social-d' && sudo systemctl status 'social-d' -l
Line 245: Line 403:
  
 [Timer] [Timer]
-OnBootSec=12h +OnBootSec=10m 
-OnUnitActiveSec=12h+OnUnitActiveSec=10m
  
 [Install] [Install]
Line 261: Line 419:
 <code> <code>
 [Service] [Service]
-User=wwwrun +User=www-data 
-Group=www+Group=www-data
 Type=oneshot Type=oneshot
  
-WorkingDirectory=/srv/www/social+WorkingDirectory=/var/www/social
 Environment="COMPOSER_CACHE_DIR=/dev/null" Environment="COMPOSER_CACHE_DIR=/dev/null"
  
-ExecStart='/usr/bin/git' -C '/srv/www/social' pull origin 'develop' +ExecStart='/usr/bin/git' -C '/var/www/social' reset --hard 'origin/develop' 
-ExecStart='/usr/bin/git' -C '/srv/www/social/addon' pull origin 'develop'+ExecStart='/usr/bin/git' -C '/var/www/social' pull origin 'develop' --rebase
  
-ExecStart='/usr/bin/composer' --working-dir='/srv/www/social' --no-cache install --no-dev+ExecStart='/usr/bin/git' -'/var/www/social/addonreset --hard 'origin/develop' 
 +ExecStart='/usr/bin/git' -C '/var/www/social/addon' pull origin 'develop' --rebase
  
-ExecStart='/usr/bin/php' '/srv/www/social/bin/console.php' dbstructure update --force +# Temp php-json-ld Fix (#15340) 
-ExecStart='/usr/bin/php' '/srv/www/social/bin/console.php' dbstructure drop --execute +ExecStart='/usr/bin/sed-i 's|https://git.friendi.ca/friendica/php-json-ld|https://github.com/digitalbazaar/php-json-ld.git|g' '/var/www/social/composer.lock
-ExecStart='/usr/bin/php' '/srv/www/social/bin/console.phppostupdate +ExecStart='/usr/bin/sed-i 's/1f33c8766b5cfbecfbc2122238873debeed35fb6/fe18c3f2ce47f30ace904ef58e7416f933be25e1/g' '/var/www/social/composer.lock'
-ExecStart='/usr/bin/php' '/srv/www/social/bin/console.phpcache clear +
-ExecStart='/usr/bin/php' '/srv/www/social/bin/console.phpclearavatarcache+
  
 +ExecStart='/usr/bin/composer' --working-dir='/var/www/social' --no-cache install --no-dev
 +
 +ExecStart='/usr/bin/php' '/var/www/social/bin/console.php' dbstructure update --force
 +ExecStart='/usr/bin/php' '/var/www/social/bin/console.php' dbstructure drop --execute
 +
 +ExecStartPost='/usr/bin/php' '/var/www/social/bin/console.php' postupdate
 ExecStartPost='/usr/bin/sync' ExecStartPost='/usr/bin/sync'
  
Line 285: Line 448:
 ==== Timer ==== ==== Timer ====
  
-  * Every day at ''04:00:00''+  * Daily ''04:00:00 AM''
  
   sudo -e '/etc/systemd/system/social-up.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'social-up.timer' --now && sudo systemctl start 'social-up' && sudo systemctl status 'social-up' -l   sudo -e '/etc/systemd/system/social-up.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'social-up.timer' --now && sudo systemctl start 'social-up' && sudo systemctl status 'social-up' -l
Line 316: Line 479:
 Type=oneshot Type=oneshot
  
-ExecStart='/usr/bin/bash' -c '"/usr/bin/tar" -czf "/home/CHANGEME/backups/friendica-files-auto-"$$(date +%%Y-%%m-%%d)".tar.gz" -C "/srv/www" "social"'+ExecStart='/usr/bin/bash' -c '"/usr/bin/tar" -czf "/home/CHANGEME/backups/friendica-files-auto-"$$(date +%%Y-%%m-%%d)".tar.gz" -C "/var/www" "social"'
  
 ExecStartPost='/usr/bin/sync' ExecStartPost='/usr/bin/sync'
Line 373: Line 536:
 === Timer === === Timer ===
  
-  * ''01'' day of every month at ''01:10:00''+  * ''01'' day of every month at ''04:10:00''
  
   sudo -e '/etc/systemd/system/social-db.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'social-db.timer' --now && sudo systemctl start 'social-db' && sudo systemctl status 'social-db' -l   sudo -e '/etc/systemd/system/social-db.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'social-db.timer' --now && sudo systemctl start 'social-db' && sudo systemctl status 'social-db' -l
Line 399: Line 562:
 <code> <code>
 [Service] [Service]
-User=wwwrun +User=www-data 
-Group=www+Group=www-data
 Type=oneshot Type=oneshot
  
-ExecStart='/usr/bin/git' -C '/srv/www/social' gc --aggressive --prune='all' +ExecStart='/usr/bin/git' -C '/var/www/social' reset --hard 
-ExecStart='/usr/bin/git' -C '/srv/www/social' fsck --full --strict+ExecStart='/usr/bin/git' -C '/var/www/social' gc --aggressive --prune='all' 
 +ExecStart='/usr/bin/git' -C '/var/www/social' fsck --full --strict
  
-ExecStart='/usr/bin/git' -C '/srv/www/social/addon' gc --aggressive --prune='all' +ExecStart='/usr/bin/git' -C '/var/www/social/addon' reset --hard 
-ExecStart='/usr/bin/git' -C '/srv/www/social/addon' fsck --full --strict+ExecStart='/usr/bin/git' -C '/var/www/social/addon' gc --aggressive --prune='all' 
 +ExecStart='/usr/bin/git' -C '/var/www/social/addon' fsck --full --strict
  
 ExecStartPost='/usr/bin/sync' ExecStartPost='/usr/bin/sync'
Line 442: Line 607:
 **** ****
  
-  sudo tar -czf ~/'friendica-files-manual-'$(date +%Y-%m-%d)'.tar.gz' -C '/srv/www' 'social'+  sudo tar -czf ~/'friendica-files-manual-'$(date +%Y-%m-%d)'.tar.gz' -C '/var/www' 'social'
  
 ===== Database ===== ===== Database =====
Line 462: Line 627:
   scp ~/'Downloads/friendica-files-'*'.tar.gz' espionage724@192.168.1.152:~   scp ~/'Downloads/friendica-files-'*'.tar.gz' espionage724@192.168.1.152:~
  
-  scp ~/'Downloads/friendica-database-'*'.sql' espionage724@192.168.1.152:~+  scp ~/'Downloads/friendica'*'.sql' espionage724@192.168.1.152:~
  
 ===== Stop nginx ===== ===== Stop nginx =====
Line 474: Line 639:
 **** ****
  
-  ls ~/'friendica-files-'*'.tar.gz' && sudo rm -Rf '/srv/www/social'+  ls ~/'friendica-files-'*'.tar.gz' && sudo rm -Rf '/var/www/social'
  
 ===== Restore Files ===== ===== Restore Files =====
Line 480: Line 645:
 **** ****
  
-  sudo tar -xzf ~/'friendica-files-'*'.tar.gz' -C '/srv/www' 'social' && sudo chown -R 'wwwrun':'www' '/srv/www/social' && sudo chmod -R '0755' '/srv/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 ===== 
 + 
 +  * :!: Set email for ''user.email'' 
 +  * :!: Requires [[#etc|Etc]] commands afterwards ((https://social.realmofespionage.xyz doesn't redirect to single-profile URL and shows an error)) 
 + 
 +  sudo su 'www-data' -s '/bin/bash' 
 + 
 +  rm -Rf '/var/www/social/.git' 
 + 
 +  git -C '/var/www/social' init --initial-branch='develop' 
 + 
 +  git -C '/var/www/social' add '.' 
 + 
 +  git -C '/var/www/social' config 'user.email' 'espionage724@x' 
 + 
 +  git -C '/var/www/social' commit --message='x' 
 + 
 +  git -C '/var/www/social' remote add 'origin' 'https://github.com/friendica/friendica.git' 
 + 
 +  git -C '/var/www/social' pull --depth '1' --recurse-submodules 'origin' 'develop' --rebase 
 + 
 +  git -C '/var/www/social' reset --hard 'origin/develop' 
 + 
 +  git -C '/var/www/social' gc --aggressive --prune='all' 
 + 
 +  git -C '/var/www/social' fsck --full --strict 
 + 
 +==== Addons ==== 
 + 
 +  * :!: Set email for ''user.email'' 
 + 
 +  rm -Rf '/var/www/social/addon/.git' 
 + 
 +  git -C '/var/www/social/addon' init --initial-branch='develop' 
 + 
 +  git -C '/var/www/social/addon' add '.' 
 + 
 +  git -C '/var/www/social/addon' config 'user.email' 'espionage724@x' 
 + 
 +  git -C '/var/www/social/addon' commit --message='x' 
 + 
 +  git -C '/var/www/social/addon' remote add 'origin' 'https://github.com/friendica/friendica-addons.git' 
 + 
 +  git -C '/var/www/social/addon' pull --depth '1' --recurse-submodules 'origin' 'develop' --rebase 
 + 
 +  git -C '/var/www/social/addon' reset --hard 'origin/develop' 
 + 
 +  git -C '/var/www/social/addon' gc --aggressive --prune='all' 
 + 
 +  git -C '/var/www/social/addon' fsck --full --strict 
 + 
 +  exit 
 + 
 +===== Database Connection ===== 
 + 
 +  sudo -u 'www-data' -e '/var/www/social/config/local.config.php' 
 + 
 +<code> 
 + 'database' => [ 
 + 'hostname' => 'localhost',</code> 
 + 
 +<code> 
 + 'system' => [ 
 + 'basepath' => '/var/www/social',</code>
  
 ===== Restore Database ===== ===== Restore Database =====
Line 490: Line 720:
   sudo mariadb --execute='CREATE DATABASE friendica;'   sudo mariadb --execute='CREATE DATABASE friendica;'
  
-  sudo mariadb 'friendica' < ~/'friendica-database-'*'.sql'+  sudo mariadb 'friendica' < ~/'friendica'*'.sql'
  
 ===== Start nginx ===== ===== Start nginx =====
Line 502: Line 732:
 **** ****
  
-  rm -fv ~/'friendica-files-'*'.tar.gz' ~/'friendica-database-'*'.sql'+  rm -fv ~/'friendica-files-'*'.tar.gz' ~/'friendica'*'.sql'
  
/var/www/wiki/data/attic/servers/linux/nginx/friendica.1757629145.txt.gz · Last modified: 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