Advertisement
Khirh

install nextcloud

Jul 1st, 2019
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.67 KB | None | 0 0
  1. #Go to the directory of the server
  2.  
  3. cd ..
  4.  
  5.  
  6. #installation the apache2,php7.0,nano,unzip and mariaDB
  7.  
  8. apt install apache2 php7.0 nano unzip mariadb-server -y
  9.  
  10.  
  11. # verification of the installation
  12.  
  13. apt policy apache2 php7.0 mariadb-server
  14.  
  15.  
  16. #update all
  17.  
  18. apt update && apt upgrade -y && apt full-upgrade -y && apt autoremove -y
  19.  
  20.  
  21. #install all php modules needed for NextCloud operation
  22.  
  23. apt install -y php7.0-gd php7.0-json php7.0-mysql php7.0-curl php7.0-mbstring php7.0-intl php7.0-mcrypt php-imagick php7.0-xml php7.0-zip -y
  24.  
  25.  
  26. #activation of Apache2 module needed
  27.  
  28. a2enmod rewrite headers env dir mime && a2enmod setenvif
  29.  
  30.  
  31. #application of apache2 changes
  32.  
  33. systemctl restart apache2
  34.  
  35.  
  36. #installation of NextCloud itself
  37.  
  38. cd .. && cd /tmp/ && wget https://download.nextcloud.com/server/releases/nextcloud-15.0.9.zip
  39.  
  40.  
  41. #setting up NextCloud in the right directory
  42.  
  43. unzip nextcloud-13.0.5.zip -d /var/www/html
  44.  
  45.  
  46. #reparting in the directory of the site to access the nextcloud
  47.  
  48. cd && cd ../var/www/ && mv html/nextcloud/* html/
  49.  
  50.  
  51. #give access to Apache2 on NextCloud
  52.  
  53. chown -R www-data:www-data /var/www/html/
  54.  
  55.  
  56. # securing the installation of the MariaDB database
  57.  
  58. mysql_secure_installation
  59.  
  60. Enter your root session password
  61.  
  62. Press "Y" and "Enter" and write the password you wish
  63.  
  64. Press the enter key again and retype your password one last time
  65.  
  66. Press "y" and "Inputs" 4 times
  67.  
  68.  
  69. #lancer MariaDB
  70.  
  71. mysql -u root -p
  72.  
  73. Enter the password previously entered
  74.  
  75. # creates the database
  76.  
  77. CREATE DATABASE nextcloud;
  78.  
  79.  
  80. # creates the user
  81.  
  82. CREATE USER '<le nom d'utilisateur de votre choix>'@'localhost' IDENTIFIED BY '<le mot de passe de votre choix>';
  83.  
  84.  
  85. # given access to the user's database
  86.  
  87. GRANT ALL PRIVILEGES ON <database name previously chosen>. * TO '<previously chosen user>' @ 'localhost';
  88.  
  89.  
  90. #apply the settings and quit
  91.  
  92. FLUSH PRIVILEGES;
  93. QUIT;
  94.  
  95.  
  96. Now go to your internet browser and type in the search bar the ip of your server.
  97.  
  98. In the first text fields, write a username and password of your choice. This will be the administrator account.
  99.  
  100. At the bottom of the page in the first field write the username of the previously written database
  101.  
  102. Tracking the user's password and the user's name
  103.  
  104. Then click on finish the installation
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113. how to move your nextcloud data to a new location.
  114.  
  115. The steps used in the are below:
  116.  
  117. #Stop apache2
  118.  
  119. sudo service apache2 stop
  120.  
  121. #Create New Folder
  122.  
  123. mkdir /mnt/nextcloud_data
  124.  
  125. #Edit config file in default location
  126.  
  127. sudo nano /var/www/html/config/config.php
  128.  
  129. #Change default location to new location on the config file
  130.  
  131. 'datadirectory' => ' /var/www/html/data',    to    'datadirectory' => '/mnt/nextcloud_data',
  132.  
  133.  
  134. #Move the data folder to new location
  135.  
  136. sudo mv /var/www/html/data /mnt/nextcloud_data
  137.  
  138. **********************************************************************
  139. if required change permissions
  140.  
  141. sudo chown -R www-data:www-data /mnt/nextcloud_data
  142.  
  143. **********************************************************************
  144.  
  145. #Restart apache2
  146.  
  147. sudo service apache2 start
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158. #update nextcloud from ssh
  159.  
  160. /usr/sbin/service apache2 stop
  161.  
  162. #Delete the NextCloud Folder on /var/www/html
  163.  
  164. sudo -u www-data php /var/www/html/updater/updater.phar
  165.  
  166. /usr/sbin/service apache2 start
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173. #Changeing HTTP Port
  174.  
  175. Edit /etc/apache2/ports.conf
  176. a. Change the port numbers as required or add new
  177. Edit /etc/apache2/sites-available/yournextcloud.conf
  178. a. Change 80/443 there to the ports in <VirtualHost *:80> (or 443) to what you specified in 1a.
  179. Restart Apache: sudo service apache2 restart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement