User Tools

Site Tools


servers: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
Next revisionBoth sides next revision
servers:nginx:friendica [2019/06/29 00:18] – [Service] Sean Rhoneservers:nginx:friendica [2019/10/24 13:40] – Switch back to Ubuntu Server Sean Rhone
Line 7: Line 7:
 ===== Prerequisites ===== ===== Prerequisites =====
  
-  * [[distros:fedora_server|Fedora Server]] +  * [[distros:ubuntu_server|Ubuntu Server]] 
-  * [[servers:mariadb | MariaDB]] +  * [[servers:mariadb|MariaDB]] 
-  * [[servers:nginx_php_php-fpm | nginx + PHP + PHP-FPM]] +  * [[servers:nginx_php_php-fpm|nginx + PHP + PHP-FPM]] 
-  * [[servers:nginx:lets_encrypt | Let's Encrypt]]+  * [[servers:nginx:lets_encrypt|Let's Encrypt]]
  
 ====== Download Source ====== ====== Download Source ======
Line 16: Line 16:
   * :!: ''develop'' branch was broken on 2019/06/28   * :!: ''develop'' branch was broken on 2019/06/28
  
-  sudo rm -Rf '/var/www/social' && sudo git clone --branch 'master' --depth '1' --recurse-submodules 'https://github.com/friendica/friendica.git' '/var/www/social' && sudo rm -Rf '/var/www/social/addon' && sudo git clone --branch 'master' --depth '1' --recurse-submodules 'https://github.com/friendica/friendica-addons.git' '/var/www/social/addon' && sudo chown -R 'nginx':'nginx' '/var/www/social' && sync +  sudo rm -Rf '/var/www/social' && sudo git clone --branch 'master' --depth '1' --recurse-submodules 'https://github.com/friendica/friendica.git' '/var/www/social' && sudo rm -Rf '/var/www/social/addon' && sudo git clone --branch 'master' --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' && sync
- +
-===== SELinux ===== +
- +
-  sudo semanage fcontext --deleteall "/var/www/social(/.*)?" +
- +
-  sudo semanage fcontext --add --type 'httpd_sys_rw_content_t' "/var/www/social(/.*)?" +
- +
-  sudo restorecon -R -v '/var/www/social' && sync+
  
 ====== PHP Dependencies ====== ====== PHP Dependencies ======
Line 158: Line 150:
  
   * Every 5 minutes   * Every 5 minutes
 +  * :!: Refer to [[distros:fedora_server#selinux|SELinux notes]] to generate a profile for this
  
   sudo -e '/etc/systemd/system/social-d.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'social-d.timer' --now   sudo -e '/etc/systemd/system/social-d.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'social-d.timer' --now
Line 177: Line 170:
  
 ==== Service ==== ==== Service ====
 +
 +  * :!: Refer to [[distros:fedora_server#selinux|SELinux notes]] to generate a profile for this ((the composer step will likely be denied))
  
   sudo -e '/etc/systemd/system/social-up.service'   sudo -e '/etc/systemd/system/social-up.service'
Line 189: Line 184:
 ExecStart='/usr/bin/git' -C '/var/www/social' pull origin 'master' ExecStart='/usr/bin/git' -C '/var/www/social' pull origin 'master'
 ExecStart='/usr/bin/git' -C '/var/www/social/addon' pull origin 'master' ExecStart='/usr/bin/git' -C '/var/www/social/addon' pull origin 'master'
-ExecStart='/var/www/social/bin/composer.phar' install+ExecStart='/var/www/social/bin/composer.phar' install --no-dev
 ExecStartPost='/usr/bin/sync'</code> ExecStartPost='/usr/bin/sync'</code>
  
Line 387: Line 382:
 **** ****
  
-  sudo systemctl stop nginx php-fpm+  sudo systemctl stop nginx php7.2-fpm
  
 ==== Remove Previous Folder ==== ==== Remove Previous Folder ====
Line 399: Line 394:
 **** ****
  
-  cd '/var/www' && sudo tar -xvzf ~/'friendica-files-'*'.tar.gz' 'social' && sudo chown -R 'nginx':'nginx' '/var/www/social' && cd ~ && sync +  cd '/var/www' && sudo tar -xvzf ~/'friendica-files-'*'.tar.gz' 'social' && sudo chown -R 'www-data':'www-data' '/var/www/social' && cd ~ && sync
- +
-==== SELinux ==== +
- +
-  sudo semanage fcontext --deleteall "/var/www/social(/.*)?" +
- +
-  sudo semanage fcontext --add --type 'httpd_sys_rw_content_t' "/var/www/social(/.*)?" +
- +
-  sudo restorecon -R -v '/var/www/social' && sync+
  
 ==== Drop Previous Database ==== ==== Drop Previous Database ====
  
-  mysql --user='root' --password+  sudo mysql
  
   DROP DATABASE friendica;   DROP DATABASE friendica;
  
   FLUSH TABLES;   FLUSH TABLES;
 +
 +  EXIT
  
 ==== Re-create Databases ==== ==== Re-create Databases ====
  
-  mysql --user='root' --password+  sudo mysql
  
   CREATE DATABASE friendica;   CREATE DATABASE friendica;
 +
 +  EXIT
  
 ==== Restore Database ==== ==== Restore Database ====
Line 427: Line 418:
 **** ****
  
-  mysql --user='root' --password 'friendica' < ~/'friendica-database-'*'.sql' && sync+  sudo mysql 'friendica' < ~/'friendica-database-'*'.sql' && sync
  
 ==== Reapply Permissions ==== ==== Reapply Permissions ====
  
-  mysql --user='root' --password+  sudo mysql
  
   GRANT ALL PRIVILEGES ON friendica.* to 'friendica'@'localhost' IDENTIFIED BY 'x';   GRANT ALL PRIVILEGES ON friendica.* to 'friendica'@'localhost' IDENTIFIED BY 'x';
  
   FLUSH PRIVILEGES;   FLUSH PRIVILEGES;
 +
 +  EXIT
  
 ==== Start Services ==== ==== Start Services ====
Line 441: Line 434:
 **** ****
  
-  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