Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
virtualisation:nextcloud [2018/02/28 07:50] buettnervirtualisation:nextcloud [2018/03/01 09:19] (current) buettner
Line 1: Line 1:
-=====How to setup Nextcloud on a NB2800 router=====+======How to setup Nextcloud on a NB2800 router======
  
 This article describes how to setup a Nextcloud server on your NB2800 router. This article describes how to setup a Nextcloud server on your NB2800 router.
  
-[[https://nextcloud.com/|Nextcloud]] is a free and open source cloud hosting software. It lets you easily provide files for and share them with others, and lets you customize your cloud with a lot of tools and additional apps.+[[https://nextcloud.com/|Nextcloud]] is a free and open source cloud hosting software. It lets you easily share your files with others, hosts your own calenders and contact lists and lets you customize your cloud with a lot of tools and additional apps.
  
 ===Preparations=== ===Preparations===
- 
-All basic preparations made are described in this article: [[http://wiki.netmodule.com/virtualisation/file-server | How to set up a NB2800 File Server ]] 
  
 If you need instructions on how to set up a LXC Container on NB2800 Routers, you can refer to this page: http://wiki.netmodule.com/app-notes/virtualisation.  If you need instructions on how to set up a LXC Container on NB2800 Routers, you can refer to this page: http://wiki.netmodule.com/app-notes/virtualisation. 
 +
 +The first step you should take is to give your router a static IP adress. For this, use 
 +<code>
 +nano /etc/network/interfaces
 +</code>
 +and set up a static IP configuration for your primary interface. In this example, the configuration for the eth0 interface looks like this:
 +<konsole>
 +auto eth0
 +iface eth0 inet static
 +address 192.168.1.50
 +netmask 255.255.255.0
 +network 192.168.1.0
 +broadcast 192.168.1.255
 +gateway 192.168.1.105
 +dns-nameservers 192.168.1.105
 +</konsole>
 +
 +After that, use 
 +<code>
 +apt-get update
 +apt-get upgrade
 +</code>
 +to bring your system up to date.
 +
 +If your network setup doesn't include a domain you could use on your router, you can easily create one you can use to access your file server.
 +
 +For this, get access to the routers web interface and go to Services -> DNS Server. Under "Static Hosts" , click on the plus symbol to add a new domain name.
 +
 +Now enter the IP address and the domain name you want it linked to and click "Apply"
 +{{ :virtualisation:local_domain_lxc2.png?nolink&600 |}}
 +
 +
 +After this, your configuration should look like this:
 +
 +{{ :virtualisation:local_domain_lxc.png?nolink&600 |}}
 +
 +Now you can access the file server with both its IP address a its local domain name.
 +
  
 ===Installations=== ===Installations===
  
-Before Nextcloud can be installed, some other programs need to be installed and set up. In the first step, install all necessary programs by entering+Before Nextcloud can be installed, a web server (here: Nginx), a SQL program (here: MariaDB) and PHP need to be installed and set up. In the first step, install these programs by entering
 <code> <code>
 +apt-get update
 apt-get install nginx mariadb-client mariadb-server php7.0-common php7.0-fpm php7.0-cli php7.0-json php7.0-mysql php7.0-curl php7.0-intl php7.0-mcrypt php-pear php7.0-gd php7.0-zip php7.0-xml php7.0-mbstring php7.0-apcu apt-get install nginx mariadb-client mariadb-server php7.0-common php7.0-fpm php7.0-cli php7.0-json php7.0-mysql php7.0-curl php7.0-intl php7.0-mcrypt php-pear php7.0-gd php7.0-zip php7.0-xml php7.0-mbstring php7.0-apcu
 </code> </code>
Line 25: Line 62:
 ===Configuring PHP=== ===Configuring PHP===
  
-For setting up PHP, several values in three files have to be edited. First, go to /etc/php/7.0/fpm/pool.d/www.conf and edit the following values (Note: all values described here have to be edited, decommented or added):+For setting up PHP, several values in three files have to be edited. First, go to /etc/php/7.0/fpm/pool.d/www.conf and edit the following values (Note: all values described here have to be edited, decommentedor added):
 <code c /etc/php/7.0/fpm/pool.d/www.conf> <code c /etc/php/7.0/fpm/pool.d/www.conf>
 user = www-data user = www-data
Line 73: Line 110:
 service mysql restart service mysql restart
 </code> </code>
-Now you have to create a new MariaDB database and an user which is only needed for Nextcloud access. To enter the MariaDB editing  shell, enter+Now you have to create a new MariaDB database and an user which is only needed for Nextcloud access. To enter the MariaDB shell, enter
 <code> <code>
 mysql -u root -p mysql -u root -p
Line 87: Line 124:
 Note that you have to enter your own credentials for 'user' and 'password'. Note that you have to enter your own credentials for 'user' and 'password'.
  
-Now all necessary right have to be granted to this new user:+Now all necessary rights have to be granted to this new user:
 <code> <code>
 grant all privileges on nextcloud_db.* to 'user'@localhost; grant all privileges on nextcloud_db.* to 'user'@localhost;
Line 297: Line 334:
 rm nextcloud-13.0.0.tar.bz2 rm nextcloud-13.0.0.tar.bz2
 </code> </code>
-Now you have to set the user and group to the Nextcloud folder:+Now you have to set the correct user and group to the Nextcloud folder:
 <code> <code>
 chown -R www-data:www-data /var/www/nextcloud chown -R www-data:www-data /var/www/nextcloud