apfelcast

Nextcloud on Google Cloud

Oct 31st, 2019
1,572
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. #### Install Nextcloud on Google Cloud VM ####
  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. --> Domain ansurfen und Einrichtung abschließen
  71.  
  72.  
  73. ## create Let's Encrypt SSL-Certificate
  74.  
  75. #install certbot
  76. apt-get install python-certbot-apache
  77.  
  78. certbot --apache -m [email protected] -d cloud.domain.com
  79.  
  80. #--> only lasts 90 days
  81.  
  82. #install crontab
  83. crontab -e
  84.  
  85. 0 1 * * * /usr/bin/certbot renew & > /dev/nul
Add Comment
Please, Sign In to add comment