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/22 00:34] – [php-json-ld Fix] Sean Rhoneservers:linux:nginx:friendica [2026/01/01 04:41] (current) – [Etc] Sean Rhone
Line 11: Line 11:
 ===== Prerequisites ===== ===== Prerequisites =====
  
-  * [[linux:distros:server:ubuntu_server|Ubuntu Server]]+  * [[linux:distros:server:opensuse_tumbleweed_server|openSUSE Tumbleweed (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 21: Line 21:
   * https://wiki.friendi.ca/docs/install#requirements   * https://wiki.friendi.ca/docs/install#requirements
  
-  sudo apt install composer php-curl php-gd php-gmp php-mbstring php-intl php-mysql php-zip+  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
  
 ====== Download Source ====== ====== Download Source ======
Line 27: 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-data' '/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' '/srv/www/social' && sudo chown -R 'wwwrun':'www' '/srv/www/social' && sudo chmod -R '0755' '/srv/www/social'
  
 ===== Addons ===== ===== Addons =====
Line 34: 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-data' '/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' '/srv/www/social/addon' && sudo chown -R 'wwwrun':'www' '/srv/www/social/addon' && sudo chmod -R '0755' '/srv/www/social/addon'
  
 ====== Environment ====== ====== Environment ======
Line 40: Line 40:
 ===== Composer ===== ===== Composer =====
  
-  sudo su 'www-data' -s '/bin/bash'+  sudo su 'wwwrun' -s '/bin/bash'
  
-  cd '/tmp' && '/usr/bin/composer' --working-dir='/var/www/social' --no-cache install --no-dev+  cd '/tmp' && '/usr/bin/composer' --working-dir='/srv/www/social' --no-cache install --no-dev
  
   exit   exit
- 
-===== php-json-ld Fix ===== 
- 
-  * [[https://github.com/friendica/friendica/issues/15340|#15340]] 
-  * TODO: ''sed'' 
- 
-  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> 
  
 ====== Database ====== ====== Database ======
Line 84: Line 62:
 ===== PHP-FPM Socket ===== ===== PHP-FPM Socket =====
  
-  sudo -e '/etc/php/8.4/fpm/pool.d/social.conf' && sudo systemctl restart 'php8.4-fpm'+  sudo -e '/etc/php8/fpm/php-fpm.d/social.conf' && sudo systemctl restart 'php-fpm'
  
 <code> <code>
Line 90: Line 68:
  
 ; User/Group ; User/Group
-user = "www-data+user = "wwwrun
-group = "www-data"+group = "www"
  
 ; Socket ; Socket
-listen = "/run/php/social.sock" +listen = "/run/php-fpm/social.sock" 
-listen.owner = "www-data+listen.owner = "wwwrun
-listen.group = "www-data"+listen.group = "www"
 listen.mode = "0662" listen.mode = "0662"
  
Line 110: Line 88:
 ; General ; General
 php_value[date.timezone] = "America/New_York" php_value[date.timezone] = "America/New_York"
 +
 +; openSUSE php.ini Defaults
 +php_value[session.save_path] = "/var/lib/php8/sessions"
  
 ; Friendica ; 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] = "100M+php_value[post_max_size] = "10M
-php_value[upload_max_filesize] = "20M"+php_value[upload_max_filesize] = "10M"
 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 123: Line 104:
 ===== FastCGI ===== ===== FastCGI =====
  
-  sudo -e '/etc/nginx/snippets/social.conf'+  sudo -e '/etc/nginx/default.d/social.conf'
  
 <code> <code>
Line 136: Line 117:
  fastcgi_param 'HTTPS' 'on';  fastcgi_param 'HTTPS' 'on';
  
- fastcgi_pass 'unix:/run/php/social.sock';+ fastcgi_pass 'unix:/run/php-fpm/social.sock';
  
 } }
Line 144: Line 125:
 ===== Server Block ===== ===== Server Block =====
  
-  * :!: ''sites-enabled'' should be done after [[#initialize]] +  sudo -e '/etc/nginx/vhosts.d/social.conf' && sudo systemctl reload 'nginx'
- +
-  sudo -e '/etc/nginx/sites-available/social.conf'+
  
 <code> <code>
Line 154: Line 133:
  http2 'on';  http2 'on';
  server_name 'social.realmofespionage.xyz';  server_name 'social.realmofespionage.xyz';
- root '/var/www/social';+ root '/srv/www/social';
  index 'index.php';  index 'index.php';
  
- include '/etc/nginx/snippets/social.conf'; + include '/etc/nginx/default.d/social.conf'; 
- include '/etc/nginx/snippets/headers.conf';+ include '/etc/nginx/default.d/headers.conf';
  
  client_max_body_size '10M';  client_max_body_size '10M';
Line 185: Line 164:
  
 # 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 197: Line 174:
   * :?: Might be able to use ''--file'' on manually-created [[#localconfigphp|local.config.php]] instead   * :?: Might be able to use ''--file'' on manually-created [[#localconfigphp|local.config.php]] instead
  
-  sudo su 'www-data' -s '/bin/bash'+  sudo su 'wwwrun' -s '/bin/bash'
  
-  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'+  cd '/srv/www/social' && '/srv/www/social/bin/console' autoinstall --dbhost 'localhost' --dbport '3365' --dbdata 'friendica' --dbuser 'friendica' --url 'https://social.realmofespionage.xyz' --basepath '/srv/www/social' --dbpass 'x' --admin 'x'
  
 ===== Account Create ===== ===== Account Create =====
Line 210: Line 187:
   * :!: ''x'' is the **nickname** chosen at website registration   * :!: ''x'' is the **nickname** chosen at website registration
  
-  sudo su 'www-data' -s '/bin/bash'+  sudo su 'wwwrun' -s '/bin/bash'
  
-  cd '/var/www/social' && '/var/www/social/bin/console' user password 'x'+  cd '/srv/www/social' && '/srv/www/social/bin/console' user password 'x'
  
 ===== Disable Registration ===== ===== Disable Registration =====
  
-  sudo su 'www-data' -s '/bin/bash'+  sudo su 'wwwrun' -s '/bin/bash'
  
-  cd '/var/www/social' && '/usr/bin/php' '/var/www/social/bin/console.php' config 'config' 'register_policy' '0'+  cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' config 'config' 'register_policy' '0'
  
 ===== Etc ===== ===== Etc =====
  
-  cd '/var/www/social&& '/usr/bin/php'/var/www/social/bin/console.php' -h+  sudo su 'wwwrun-s '/bin/bash'
  
-  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' worker
  
-  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 update --force
  
-  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' dbstructure drop --execute
  
-  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' postupdate
  
-  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' cache clear
  
-  cd '/var/www/social' && '/usr/bin/php' '/var/www/social/bin/console.php' clearavatarcache+  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' config 'config' 'info' 'https://wiki.realmofespionage.xyz/servers:linux:nginx:friendica'+  cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' config 'system' 'basepath' '/srv/www/social' 
 + 
 +  cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' config 'config' 'info' 'https://wiki.realmofespionage.xyz/servers:linux:nginx:friendica'
  
   exit   exit
Line 258: Line 237:
   * :!: Change database ''password'' and config ''admin_email''   * :!: Change database ''password'' and config ''admin_email''
  
-  sudo -'www-data' -'/var/www/social/config/local.config.php'+  sudo -'/srv/www/social/config/local.config.php&& sudo chown -v 'wwwrun':'www' '/srv/www/social/config/local.config.php'
  
 <code> <code>
Line 281: Line 260:
         'system' => [         'system' => [
                 'url' => 'https://social.realmofespionage.xyz',                 'url' => 'https://social.realmofespionage.xyz',
-                'basepath' => '/var/www/social',+                'basepath' => '/srv/www/social',
                 'default_timezone' => 'America/New_York',                 'default_timezone' => 'America/New_York',
                 'language' => 'en',                 'language' => 'en',
Line 293: Line 272:
 ===== Git Fix ===== ===== Git Fix =====
  
-  * :!: Set email for ''user.email''+  * :!: 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'+  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 'wwwrun':'www' '/etc/nginx/scripts/social/git-fix.sh'
  
 <code> <code>
-TODO</code>+#!/bin/bash
  
-  sudo -'www-data' '/etc/nginx/scripts/social/git-fix.sh'+cd '/tmp' 
 + 
 +'/usr/bin/rm' -Rf '/srv/www/social/.git' 
 +'/usr/bin/git' -C '/srv/www/social' init --initial-branch='develop' 
 +'/usr/bin/git' -C '/srv/www/social' add '.' 
 + 
 +######################################## 
 +'/usr/bin/git' -C '/srv/www/social' config 'user.email' 'espionage724@x' 
 +######################################## 
 + 
 +'/usr/bin/git' -C '/srv/www/social' commit --message='x' 
 + 
 +'/usr/bin/git' -C '/srv/www/social' remote add 'origin' 'https://github.com/friendica/friendica.git' 
 +'/usr/bin/git' -C '/srv/www/social' pull --depth '1' --recurse-submodules 'origin' 'develop' --rebase 
 + 
 +'/usr/bin/git' -C '/srv/www/social' reset --hard 'origin/develop' 
 +'/usr/bin/git' -C '/srv/www/social' gc --aggressive --prune='all' 
 +'/usr/bin/git' -C '/srv/www/social' fsck --full --strict 
 + 
 +'/usr/bin/rm' -Rf '/srv/www/social/addon/.git' 
 +'/usr/bin/git' -C '/srv/www/social/addon' init --initial-branch='develop' 
 +'/usr/bin/git' -C '/srv/www/social/addon' add '.' 
 + 
 +######################################## 
 +'/usr/bin/git' -C '/srv/www/social/addon' config 'user.email' 'espionage724@x' 
 +######################################## 
 + 
 +'/usr/bin/git' -C '/srv/www/social/addon' commit --message='x' 
 + 
 +'/usr/bin/git' -C '/srv/www/social/addon' remote add 'origin' 'https://github.com/friendica/friendica-addons.git' 
 +'/usr/bin/git' -C '/srv/www/social/addon' pull --depth '1' --recurse-submodules 'origin' 'develop' --rebase 
 + 
 +'/usr/bin/git' -C '/srv/www/social/addon' reset --hard 'origin/develop' 
 +'/usr/bin/git' -C '/srv/www/social/addon' gc --aggressive --prune='all' 
 +'/usr/bin/git' -C '/srv/www/social/addon' fsck --full --strict 
 + 
 +# End</code> 
 + 
 +==== Execute ==== 
 + 
 +  sudo su 'wwwrun' -s '/bin/bash' 
 + 
 +  '/etc/nginx/scripts/social/git-fix.sh' 
 + 
 +  exit
  
 ====== Services ====== ====== Services ======
  
 ===== Worker ===== ===== Worker =====
 +
 +  * https://wiki.friendi.ca/docs/install#required_background_tasks
  
 ==== Service ==== ==== Service ====
Line 312: Line 337:
 <code> <code>
 [Service] [Service]
-User=www-data +User=wwwrun 
-Group=www-data+Group=www
 Type=oneshot Type=oneshot
  
-WorkingDirectory=/var/www/social+WorkingDirectory=/srv/www/social
  
-ExecStart='/usr/bin/php' '/var/www/social/bin/console.php' worker +ExecStart='/usr/bin/php' '/srv/www/social/bin/console.php' worker
- +
-ExecStartPost='/usr/bin/sync'+
  
 # End</code> # End</code>
Line 326: Line 349:
 ==== Timer ==== ==== Timer ====
  
-  * Every 10 minutes (([[https://wiki.friendi.ca/docs/install#required_background_tasks|info]]))+  * Every 10 minutes
  
   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 353: Line 376:
 <code> <code>
 [Service] [Service]
-User=www-data +User=wwwrun 
-Group=www-data+Group=www
 Type=oneshot Type=oneshot
  
-WorkingDirectory=/var/www/social+WorkingDirectory=/srv/www/social
 Environment="COMPOSER_CACHE_DIR=/dev/null" Environment="COMPOSER_CACHE_DIR=/dev/null"
  
-ExecStart='/usr/bin/git' -C '/var/www/social' pull origin 'develop' +ExecStart='/usr/bin/git' -C '/srv/www/social' reset --hard 'origin/develop' 
-ExecStart='/usr/bin/git' -C '/var/www/social/addon' pull origin 'develop'+ExecStart='/usr/bin/git' -C '/srv/www/social' pull origin 'develop' --rebase
  
-ExecStart='/usr/bin/composer' --working-dir='/var/www/social' --no-cache install --no-dev+ExecStart='/usr/bin/git' -'/srv/www/social/addonreset --hard 'origin/develop' 
 +ExecStart='/usr/bin/git' -C '/srv/www/social/addon' pull origin 'develop' --rebase
  
-ExecStart='/usr/bin/php'/var/www/social/bin/console.php' dbstructure update --force +ExecStart='/usr/bin/composer' --working-dir='/srv/www/social' --no-cache install --no-dev
-ExecStart='/usr/bin/php' '/var/www/social/bin/console.phpdbstructure drop --execute +
-ExecStart='/usr/bin/php' '/var/www/social/bin/console.php' postupdate +
-ExecStart='/usr/bin/php' '/var/www/social/bin/console.php' cache clear +
-ExecStart='/usr/bin/php' '/var/www/social/bin/console.php' clearavatarcache+
  
 +ExecStart='/usr/bin/php' '/srv/www/social/bin/console.php' dbstructure update --force
 +ExecStart='/usr/bin/php' '/srv/www/social/bin/console.php' dbstructure drop --execute
 +
 +ExecStartPost='/usr/bin/php' '/srv/www/social/bin/console.php' postupdate
 ExecStartPost='/usr/bin/sync' ExecStartPost='/usr/bin/sync'
  
Line 377: Line 401:
 ==== 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 408: Line 432:
 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 "/var/www" "social"'+WorkingDirectory=/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 "/srv/www" "social"'
  
 ExecStartPost='/usr/bin/sync' ExecStartPost='/usr/bin/sync'
Line 416: Line 442:
 === Timer === === Timer ===
  
-  * ''01'' day of every month at ''04:15:00''+  * Monthly (5th) ''04:15:00 AM''
  
   sudo -e '/etc/systemd/system/social-fb.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'social-fb.timer' --now   sudo -e '/etc/systemd/system/social-fb.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'social-fb.timer' --now
Line 425: Line 451:
  
 [Timer] [Timer]
-OnCalendar=*-*-01 04:15:00+OnCalendar=*-*-05 04:15:00
 Persistent=true Persistent=true
  
Line 439: Line 465:
 === Database Auth === === Database Auth ===
  
-  sudo mkdir -p '/var/lib/mysql/auth' && sudo -e '/var/lib/mysql/auth/friendica' && sudo chown 'mysql':'mysql' '/var/lib/mysql/auth/friendica' && sudo chmod '0600' '/var/lib/mysql/auth/friendica'+  sudo mkdir -p '/srv/lib/mysql/auth' && sudo -e '/srv/lib/mysql/auth/friendica' && sudo chown 'mysql':'mysql' '/srv/lib/mysql/auth/friendica' && sudo chmod '0600' '/srv/lib/mysql/auth/friendica'
  
 <code> <code>
Line 450: Line 476:
 === Service === === Service ===
  
-  mkdir -p ~/'backups' && sudo mkdir -p '/var/lib/mysql/tmp' && sudo -e '/etc/systemd/system/social-db.service' && sudo sed -i 's/'CHANGEME'/'$USER'/g' '/etc/systemd/system/social-db.service'+  mkdir -p ~/'backups' && sudo mkdir -p '/srv/lib/mysql/tmp' && sudo -e '/etc/systemd/system/social-db.service' && sudo sed -i 's/'CHANGEME'/'$USER'/g' '/etc/systemd/system/social-db.service'
  
 <code> <code>
Line 457: Line 483:
 Type=oneshot Type=oneshot
  
-ExecStart='/usr/bin/bash' -c '"/usr/bin/mariadb-dump" --defaults-extra-file="/var/lib/mysql/auth/friendica" --single-transaction --quick "friendica" -r "/home/CHANGEME/backups/friendica-database-auto-"$$(date +%%Y-%%m-%%d)".sql"'+WorkingDirectory=/srv/lib/mysql 
 + 
 +ExecStart='/usr/bin/bash' -c '"/usr/bin/mariadb-dump" --defaults-extra-file="/srv/lib/mysql/auth/friendica" --single-transaction --quick "friendica" -r "/home/CHANGEME/backups/friendica-database-auto-"$$(date +%%Y-%%m-%%d)".sql"'
  
 ExecStartPost='/usr/bin/sync' ExecStartPost='/usr/bin/sync'
Line 465: Line 493:
 === Timer === === Timer ===
  
-  * ''01'' day of every month at ''04:10:00''+  * Monthly (5th) ''04:10:00 AM''
  
   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 475: Line 503:
  
 [Timer] [Timer]
-OnCalendar=*-*-01 04:10:00+OnCalendar=*-*-05 04:10:00
 Persistent=true Persistent=true
  
Line 491: Line 519:
 <code> <code>
 [Service] [Service]
-User=www-data +User=wwwrun 
-Group=www-data+Group=www
 Type=oneshot Type=oneshot
  
-ExecStart='/usr/bin/git' -C '/var/www/social' reset --hard +WorkingDirectory=/srv/www/social 
-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' gc --aggressive --prune='all' 
 +ExecStart='/usr/bin/git' -C '/srv/www/social' fsck --full --strict 
 + 
 +ExecStart='/usr/bin/git' -C '/srv/www/social/addon' gc --aggressive --prune='all' 
 +ExecStart='/usr/bin/git' -C '/srv/www/social/addon' fsck --full --strict
  
-ExecStart='/usr/bin/git-C '/var/www/social/addonreset --hard +ExecStart='/usr/bin/php' '/srv/www/social/bin/console.phpcache clear 
-ExecStart='/usr/bin/git-C '/var/www/social/addon' gc --aggressive --prune='all' +ExecStart='/usr/bin/php' '/srv/www/social/bin/console.phpclearavatarcache
-ExecStart='/usr/bin/git' -C '/var/www/social/addonfsck --full --strict+
  
 ExecStartPost='/usr/bin/sync' ExecStartPost='/usr/bin/sync'
Line 509: Line 540:
 ==== Timer ==== ==== Timer ====
  
-  * ''01'' day of every month at ''04:30:00''+  * Monthly (5th) ''04:30:00 AM''
  
   sudo -e '/etc/systemd/system/social-m.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'social-m.timer' --now   sudo -e '/etc/systemd/system/social-m.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'social-m.timer' --now
Line 520: Line 551:
  
 [Timer] [Timer]
-OnCalendar=*-*-01 04:30:00+OnCalendar=*-*-05 04:30:00
 Persistent=true Persistent=true
  
Line 536: Line 567:
 **** ****
  
-  sudo tar -czf ~/'friendica-files-manual-'$(date +%Y-%m-%d)'.tar.gz' -C '/var/www' 'social'+  sudo tar -czf ~/'friendica-files-manual-'$(date +%Y-%m-%d)'.tar.gz' -C '/srv/www' 'social'
  
 ===== Database ===== ===== Database =====
Line 568: Line 599:
 **** ****
  
-  ls ~/'friendica-files-'*'.tar.gz' && sudo rm -Rf '/var/www/social'+  ls ~/'friendica-files-'*'.tar.gz' && sudo rm -Rf '/srv/www/social'
  
 ===== Restore Files ===== ===== Restore Files =====
Line 574: Line 605:
 **** ****
  
-  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'+  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'
  
 ===== Git Fix ===== ===== Git Fix =====
Line 581: Line 612:
   * :!: Requires [[#etc|Etc]] commands afterwards ((https://social.realmofespionage.xyz doesn't redirect to single-profile URL and shows an error))   * :!: 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'+  sudo su 'wwwrun' -s '/bin/bash'
  
-  rm -Rf '/var/www/social/.git'+  rm -Rf '/srv/www/social/.git'
  
-  git -C '/var/www/social' init --initial-branch='develop'+  git -C '/srv/www/social' init --initial-branch='develop'
  
-  git -C '/var/www/social' add '.'+  git -C '/srv/www/social' add '.'
  
-  git -C '/var/www/social' config 'user.email' 'espionage724@x'+  git -C '/srv/www/social' config 'user.email' 'espionage724@x'
  
-  git -C '/var/www/social' commit --message='x'+  git -C '/srv/www/social' commit --message='x'
  
-  git -C '/var/www/social' remote add 'origin' 'https://github.com/friendica/friendica.git'+  git -C '/srv/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 '/srv/www/social' pull --depth '1' --recurse-submodules 'origin' 'develop' --rebase
  
-  git -C '/var/www/social' reset --hard 'origin/develop'+  git -C '/srv/www/social' reset --hard 'origin/develop'
  
-  git -C '/var/www/social' gc --aggressive --prune='all'+  git -C '/srv/www/social' gc --aggressive --prune='all'
  
-  git -C '/var/www/social' fsck --full --strict+  git -C '/srv/www/social' fsck --full --strict
  
 ==== Addons ==== ==== Addons ====
Line 607: Line 638:
   * :!: Set email for ''user.email''   * :!: Set email for ''user.email''
  
-  rm -Rf '/var/www/social/addon/.git'+  rm -Rf '/srv/www/social/addon/.git'
  
-  git -C '/var/www/social/addon' init --initial-branch='develop'+  git -C '/srv/www/social/addon' init --initial-branch='develop'
  
-  git -C '/var/www/social/addon' add '.'+  git -C '/srv/www/social/addon' add '.'
  
-  git -C '/var/www/social/addon' config 'user.email' 'espionage724@x'+  git -C '/srv/www/social/addon' config 'user.email' 'espionage724@x'
  
-  git -C '/var/www/social/addon' commit --message='x'+  git -C '/srv/www/social/addon' commit --message='x'
  
-  git -C '/var/www/social/addon' remote add 'origin' 'https://github.com/friendica/friendica-addons.git'+  git -C '/srv/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 '/srv/www/social/addon' pull --depth '1' --recurse-submodules 'origin' 'develop' --rebase
  
-  git -C '/var/www/social/addon' reset --hard 'origin/develop'+  git -C '/srv/www/social/addon' reset --hard 'origin/develop'
  
-  git -C '/var/www/social/addon' gc --aggressive --prune='all'+  git -C '/srv/www/social/addon' gc --aggressive --prune='all'
  
-  git -C '/var/www/social/addon' fsck --full --strict+  git -C '/srv/www/social/addon' fsck --full --strict
  
   exit   exit
Line 631: Line 662:
 ===== Database Connection ===== ===== Database Connection =====
  
-  sudo -'www-data' -'/var/www/social/config/local.config.php'+  sudo -'/srv/www/social/config/local.config.php&& sudo chown -v 'wwwrun':'www' '/srv/www/social/config/local.config.php'
  
 <code> <code>
Line 639: Line 670:
 <code> <code>
  'system' => [  'system' => [
- 'basepath' => '/var/www/social',</code>+ 'basepath' => '/srv/www/social',</code>
  
 ===== Restore Database ===== ===== Restore Database =====
Line 662: Line 693:
  
   rm -fv ~/'friendica-files-'*'.tar.gz' ~/'friendica'*'.sql'   rm -fv ~/'friendica-files-'*'.tar.gz' ~/'friendica'*'.sql'
 +
 +====== Quick Commands ======
 +
 +===== Commands =====
 +
 +  sudo su 'wwwrun' -s '/bin/bash'
 +
 +  cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' -h
 +
 +===== Show Config =====
 +
 +  sudo su 'wwwrun' -s '/bin/bash'
 +
 +  cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' config
  
/srv/www/wiki/data/attic/servers/linux/nginx/friendica.1766381696.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