apfelcast

Nextcloud Hyper-V

Feb 13th, 2020
5,330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. ##### Install Nextcloud on Debian & Hyper-V #####
  2.  
  3. # apt get update & upgrade
  4.  
  5. # install apache
  6. apt install apache2
  7.  
  8. # directory listing deaktivieren
  9. sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/apache2/apache2.conf
  10.  
  11. # start apache service
  12. systemctl start apache2.service
  13.  
  14. # install Marai DB
  15. apt install mariadb-server mariadb-client
  16.  
  17. # Maria DB Server Konfiguration
  18. mysql_secure_installation
  19.  
  20. Enter current password for root (enter for none): Just press the Enter
  21. Set root password? [Y/n]: Y
  22. New password: Enter password
  23. Re-enter new password: Repeat password
  24. Remove anonymous users? [Y/n]: Y
  25. Disallow root login remotely? [Y/n]: Y
  26. Remove test database and access to it? [Y/n]: Y
  27. Reload privilege tables now? [Y/n]: Y
  28.  
  29. # restart Maria DB server
  30. systemctl restart mariadb.service
  31.  
  32. ## Install PHP & Modules
  33. installing PHP 7.3
  34.  
  35. # add PHP repository
  36. apt-get install software-properties-common
  37. add-apt-repository ppa:ondrej/php
  38.  
  39. apt update
  40.  
  41.  
  42. # final PHP installation & modules
  43. 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
  44.  
  45. # adjust PHP.ini file
  46. nano /etc/php/7.3/apache2/php.ini
  47.  
  48. file_uploads = On
  49. allow_url_fopen = On
  50. memory_limit = 1024M
  51. upload_max_filesize = 16G
  52. post_max_size = 16G
  53. display_errors = Off
  54. date.timezone = Europe/Berlin
  55.  
  56.  
  57. ## create nextcloud Database
  58.  
  59. # open SQL dialoge
  60. mysql
  61.  
  62. # create database calles nextcloud
  63. CREATE DATABASE nextcloud;
  64.  
  65. # create database user with password
  66. CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'password_here';
  67.  
  68. #grant accesss to databse
  69. GRANT ALL ON nextcloud.* TO 'nextclouduser'@'localhost' IDENTIFIED BY 'password_here' WITH GRANT OPTION;
  70.  
  71. #save changes and exit
  72. FLUSH PRIVILEGES;
  73. EXIT;
  74.  
  75. ## Download lastest nextcloud version
  76. cd /tmp && wget
  77. unzip nextcloud
  78. mv nextcloud /var/www/
  79.  
  80. ## configure Apache2
  81.  
  82. #create new conf
  83. nano /etc/apache2/sites-available/nextcloud.conf
  84.  
  85. <VirtualHost *:80>
  86. ServerAdmin [email protected]
  87. DocumentRoot /var/www/nextcloud/
  88. ServerName demo.domain.com
  89. ServerAlias www.demo.domain.com
  90.  
  91. Alias /nextcloud "/var/www/nextcloud/"
  92.  
  93. <Directory /var/www/nextcloud/>
  94. Options +FollowSymlinks
  95. AllowOverride All
  96. Require all granted
  97. <IfModule mod_dav.c>
  98. Dav off
  99. </IfModule>
  100. SetEnv HOME /var/www/nextcloud
  101. SetEnv HTTP_HOME /var/www/nextcloud
  102. </Directory>
  103.  
  104. ErrorLog ${APACHE_LOG_DIR}/error.log
  105. CustomLog ${APACHE_LOG_DIR}/access.log combined
  106.  
  107. </VirtualHost>
  108.  
  109.  
  110.  
  111. # Enable the NextCloud and Rewrite Module
  112.  
  113. a2ensite nextcloud.conf
  114. a2enmod rewrite
  115. a2enmod headers
  116. a2enmod env
  117. a2enmod dir
  118. a2enmod mime
  119.  
  120. # prepare data folder
  121. chown -R www-data:www-data /var/www/nextcloud/
  122. chmod -R 755 /var/www/nextcloud/
  123.  
  124. # change apache2 standart route
  125. nano /etc/apache2/sites-available/000-default.conf
  126.  
  127. # adjust Nextcloud config.php #
  128. nano /var/www/nextcloud/config/config.php
Advertisement
Add Comment
Please, Sign In to add comment