Advertisement
apfelcast

Install Nextcloud on Ubuntu 19.04

Sep 23rd, 2019
8,176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. #### Install Nextcloud on Ubuntu 19.04 ####
  2.  
  3. # updating
  4. apt-get update
  5. apt-get upgrade
  6.  
  7. # install apache
  8. apt install apache2
  9.  
  10. # directory listing deaktivieren
  11. sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/apache2/apache2.conf
  12.  
  13. # start apache service
  14. systemctl start apache2.service
  15.  
  16. # install Marai DB
  17. apt install mariadb-server mariadb-client
  18.  
  19. # Maria DB Server Konfiguration
  20. mysql_secure_installation
  21.  
  22. Enter current password for root (enter for none): Just press the Enter
  23. Set root password? [Y/n]: Y
  24. New password: Enter password
  25. Re-enter new password: Repeat password
  26. Remove anonymous users? [Y/n]: Y
  27. Disallow root login remotely? [Y/n]: Y
  28. Remove test database and access to it? [Y/n]: Y
  29. Reload privilege tables now? [Y/n]: Y
  30.  
  31. # restart Maria DB server
  32. systemctl restart mariadb.service
  33.  
  34. ## Install PHP & Modules
  35. installing PHP 7.3
  36.  
  37. # add PHP repository
  38. apt-get install software-properties-common
  39. add-apt-repository ppa:ondrej/php
  40.  
  41. apt-get update
  42.  
  43.  
  44. # final PHP installation & modules
  45. apt install php7.3 libapache2-mod-php7.3 php7.3-common php7.3-gmp php7.3-curl php7.3-intl php7.3-mbstring php7.3-xmlrpc php7.3-mysql php7.3-gd php7.3-xml php7.3-cli php7.3-zip php7.3-imagick
  46.  
  47. # adjust PHP.ini file
  48. nano /etc/php/7.3/apache2/php.ini
  49.  
  50. file_uploads = On
  51. allow_url_fopen = On
  52. memory_limit = 1024M
  53. upload_max_filesize = 16G
  54. post_max_size = 16G
  55. display_errors = Off
  56. date.timezone = Europe/Berlin
  57.  
  58.  
  59. ## create nextcloud Database
  60.  
  61. # open SQL dialoge
  62. mysql
  63.  
  64. # create database calles nextcloud
  65. CREATE DATABASE nextcloud;
  66.  
  67. # create database user with password
  68. CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'password_here';
  69.  
  70. #grant accesss to databse
  71. GRANT ALL ON nextcloud.* TO 'nextclouduser'@'localhost' IDENTIFIED BY 'password_here' WITH GRANT OPTION;
  72.  
  73. #save changes and exit
  74. FLUSH PRIVILEGES;
  75. EXIT;
  76.  
  77. ## Download lastest nextcloud version
  78. cd /tmp && wget
  79. apt-get install unzip
  80. unzip nextcloud
  81. mv nextcloud /var/www/
  82.  
  83. ## configure Apache2
  84.  
  85. #create new conf
  86. nano /etc/apache2/sites-available/nextcloud.conf
  87.  
  88. # Enable the NextCloud and Rewrite Module
  89.  
  90. a2ensite nextcloud.conf
  91. a2enmod rewrite
  92. a2enmod headers
  93. a2enmod env
  94. a2enmod dir
  95. a2enmod mime
  96.  
  97. # restart apache
  98. systemctl restart apache2.service
  99.  
  100. # prepare data folder
  101. cd /home
  102. mkdir /home/data/
  103. chown -R www-data:www-data /home/data/
  104.  
  105. chown -R www-data:www-data /var/www/nextcloud/
  106. chmod -R 755 /var/www/nextcloud/
  107.  
  108. --> Domain ansurfen und Einrichtung abschließen
  109.  
  110. ## create Let's Encrypt SSL-Certificate
  111.  
  112. #install certbot
  113. apt-get install python-certbot-apache
  114.  
  115. certbot --apache -m master@domain.com -d cloud.domain.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement