Advertisement
apfelcast

Install Nextcloud HomeServer

Nov 18th, 2019
20,587
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. ### Install Nextcloud on Home Server ###
  2.  
  3. # updating
  4. apt-get update
  5. apt-get upgrade
  6.  
  7. # Installing LAMP-Stack
  8. apt install lamp-server^
  9.  
  10. # Install PHP Moduls
  11. apt install php-zip php-dompdf php-xml php-mbstring php-gd php-curl php-imagick php-intl unzip
  12.  
  13. # adjust PHP.ini file
  14. nano /etc/php/7.2/apache2/php.ini
  15.  
  16. file_uploads = On
  17. allow_url_fopen = On
  18. memory_limit = 1024M
  19. upload_max_filesize = 16G
  20. post_max_size = 16G
  21. display_errors = Off
  22. date.timezone = Europe/Berlin
  23.  
  24. # Maria DB Server Konfiguration
  25. mysql_secure_installation
  26.  
  27. # open SQL dialoge
  28. mysql
  29.  
  30. # create database calles nextcloud
  31. CREATE DATABASE nextcloud;
  32.  
  33. # create database user with password
  34. CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'password_here';
  35.  
  36. #grant accesss to databse
  37. GRANT ALL ON nextcloud.* TO 'nextclouduser'@'localhost' IDENTIFIED BY 'password_here' WITH GRANT OPTION;
  38.  
  39. #save changes and exit
  40. FLUSH PRIVILEGES;
  41. EXIT;
  42.  
  43. # Download lastest nextcloud version
  44. cd /tmp && wget https://download.nextcloud.com/server/releases/latest.zip
  45. unzip latest.zip
  46. mv nextcloud /var/www/
  47.  
  48. #create new conf
  49. nano /etc/apache2/sites-available/nextcloud.conf
  50.  
  51. # Enable the NextCloud and Rewrite Module
  52.  
  53. a2ensite nextcloud.conf
  54. a2enmod rewrite
  55. a2enmod headers
  56. a2enmod env
  57. a2enmod dir
  58. a2enmod mime
  59.  
  60. # restart apache
  61. systemctl restart apache2.service
  62.  
  63. # prepare data folder
  64. mkdir /home/data/
  65. chown -R www-data:www-data /home/data/
  66.  
  67. chown -R www-data:www-data /var/www/nextcloud/
  68. chmod -R 755 /var/www/nextcloud/
  69.  
  70. ## make hostname visible on network ##
  71. apt-get install avahi
  72. nano /etc/hosts
  73. add hostname
  74.  
  75. --> Domain ansurfen und Einrichtung abschließen
  76.  
  77. #install certbot
  78. apt-get install python-certbot-apache
  79.  
  80. certbot --apache -m master@domain.com -d cloud.domain.com
  81.  
  82. #--> only lasts 90 days
  83.  
  84. #install crontab
  85. crontab -e
  86.  
  87. 0 1 * * * /usr/bin/certbot renew & > /dev/nul
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement