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:file-server [2018/02/28 07:58] buettnervirtualisation:file-server [2025/04/22 14:02] (current) – [Store a local domain with a static IP address] gray
Line 1: Line 1:
-====== How to set up a NB2800 File Server ======+====== How to set up a File Server ======
  
-This Article describes how to install a file server on the NB2800 router. +===== Goal =====
  
-If you need instructions on how to set up LXC Container on NB2800 Routers, you can refer to this page: [[http://wiki.netmodule.com/app-notes/virtualisation]].+This Article describes how to install file server on NetModule Routers. 
  
-This setup contains the installation and configuration of the vsftpd FTP server, the Net2FTP web frontend for vsftpd, and Samba shares. In addition, a way is shown to transfer files from an USB stick to your container:+This setup contains the installation and configuration of the vsftpd FTP server, the Net2FTP web frontend for vsftpd, and Samba shares. In addition, a way is shown to transfer files from an USB stick to your container.
  
-==== 1) Preparations ====+===== Prerequisites =====
  
-The first step you should take is to give your router a static IP adress. For this, use  +  * NetModule Wireless Router with wireless connection 
-<code> +  * NetModule Software [[https://share.netmodule.com/public/system-software/4.9/4.9.0.102/|4.9.0.102]] or newer 
-nano /etc/network/interfaces +  * A license is required for the LXC container 
-</code> +  * Not available for legacy products NB1600, NB2700, NB3700, NB3710
-and set up a static IP configuration for your primary interfaceIn 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> +===== Setting up an LXC container and then implementing File Server ===== 
-apt-get update + 
-</code> +The link below takes you to a wiki that describes how to install and set up an LXC container on a NetModule router. 
-and  + 
-<code> +---- 
-apt-get upgrade + 
-</code> +* Set up an LXC container / [[app-notes:set-up-lxc]] 
-to bring your system up to date.+ 
 +---- 
 + 
 + 
 +Once the ''LXC container'' is installed, we can install additional components from the file server. 
 + 
 + 
 +===== Store a local domain with a static IP address ====
  
 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. 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.+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" +Now enter the IP address and the domain name you want it linked to and click ''"Apply"'' 
-{{ :virtualisation:local_domain_lxc2.png?nolink&600 |}}+ 
 +{{ :virtualisation:dns0.png?nolink&600 |}}
  
  
 After this, your configuration should look like this: After this, your configuration should look like this:
  
-{{ :virtualisation:local_domain_lxc.png?nolink&600 |}}+{{ :virtualisation:dns.png?nolink&600 |}}
  
 Now you can access the file server with both its IP address a its local domain name. Now you can access the file server with both its IP address a its local domain name.
  
- +===== - The vsftpd FTP server ====
- +
-==== 2) The vsftpd FTP server ====+
  
 Vsftpd (Very Secure File Transfer Protocol Deamon) is a very compact and secure FTP server. It provides a high amount of data security and user management features. Vsftpd (Very Secure File Transfer Protocol Deamon) is a very compact and secure FTP server. It provides a high amount of data security and user management features.
Line 122: Line 117:
 local_root=/home/Media local_root=/home/Media
 allow_writeable_chroot=YES allow_writeable_chroot=YES
-force_ssl_enable=YES+#force_ssl_enable=YES
 force_local_data_ssl=YES force_local_data_ssl=YES
 force_local_logins_ssl=YES force_local_logins_ssl=YES
Line 153: Line 148:
 [[https://www.net2ftp.com/|Net2FTP]] is a web interface for FTP servers. With this, you can up-and download files to your server just with your web browser and without the need of additional tools like FileZilla. [[https://www.net2ftp.com/|Net2FTP]] is a web interface for FTP servers. With this, you can up-and download files to your server just with your web browser and without the need of additional tools like FileZilla.
  
-First, you have to download the Software from this  [[https://www.net2ftp.com/homepage/download.html|Site]] (net2ftp_v1.1.zip, 6MB). After unzipping the folder, you now have a folder named "filed_to_upload". Rename this folder to a name you want to access your file server later (e.g. FTPserver).+First, you have to download the Software from this  [[https://www.net2ftp.com/index.php?state=homepage&state2=3|Site]] (net2ftp_v1.3.zip, 6MB). After unzipping the folder, you now have a folder named "filed_to_upload". Rename this folder to a name you want to access your file server later (e.g. FTPserver).
  
 In the next step, you have to install a web server and PHP in your container: In the next step, you have to install a web server and PHP in your container:
Line 163: Line 158:
 After this, upload your downloaded and renamed folder to your web servers default location (e.g. /var/www/html). Now you can access the FTP server over the name of this folder (For example, if your domain is mediacontainer.local and you renamed the folder to ftpserver, you can access it via http://mediacontainer.local/ftpserver). After this, upload your downloaded and renamed folder to your web servers default location (e.g. /var/www/html). Now you can access the FTP server over the name of this folder (For example, if your domain is mediacontainer.local and you renamed the folder to ftpserver, you can access it via http://mediacontainer.local/ftpserver).
  
-You also have to change the rigths of the temp folder in your uploaded folder. Fot this, go to this folder and type+You also have to change the rights of the temp folder in your uploaded folder. Fot this, go to this folder and type
 <code> <code>
 chmod 777 temp chmod 777 temp
Line 344: Line 339:
 This file contains the hash values of the password the user uses to login to the router. So this file is necessary automatically run actions with root level access. This file contains the hash values of the password the user uses to login to the router. So this file is necessary automatically run actions with root level access.
  
-In the next step you have to create the "autorun.sh" file. This file contains the tasks which are run when the stick is plugged into the router. To create this file under windows, open the Editor, create a new file and fill it with the code you want it to run. Then, go to "Save As", enter "autorun.sh" under "File Name" and make sure you pick "All Files" under "Save as type". Also, make sure u pick UTF-8 under Encoding. Now click on "Save" to save the file.+In the next step you have to create the "autorun.sh" file. This file contains the tasks which are run when the stick is plugged into the router. To create this file under windows, open the Editor, create a new file and fill it with the code you want it to run. Then, go to "Save As", enter "autorun.sh" under "File Name" and make sure you choose "All Files" under "Save as type". Also, make sure u select "UTF-8" in the Encoding drop-down menu. Now click on "Save" to save the file.
  
 {{ :virtualisation:autorun.sh_erstellen.png?nolink&600 |}} {{ :virtualisation:autorun.sh_erstellen.png?nolink&600 |}}
Line 356: Line 351:
 </konsole> </konsole>
  
-In the second example, all files in the container will be replaced by the files stored on the USB stick. With this, you get an one-to-one copy of your USB stick:+In the second example, all files in the container will be replaced by the files stored on the USB stick. You will get an one-to-one copy of your USB stick:
 <konsole> <konsole>
 rsync -arv --delete /mnt/media/autorun/Video-trans/ /mnt/storage1/lxc/guest1/home/Media/Videos rsync -arv --delete /mnt/media/autorun/Video-trans/ /mnt/storage1/lxc/guest1/home/Media/Videos
Line 363: Line 358:
 </konsole> </konsole>
  
-Now format an USB stick to the FAT16 oder FAT32 file format. Copy the "autorun.key" file together with the "autorun.sh" file and the files/folders you want to transfer to your file server on it+Now format an USB stick to the FAT16 oder FAT32 file format. Copy to it the "autorun.key" file together with the "autorun.sh" file and the files/folders you want to transfer. 
-{{ :virtualisation:usb_3.png?nolink&600 |}}+<konsole> 
 +/mnt/media/autorun $ ls -lh 
 +drw-r--r--    2 root     root        8.0K Feb  1 10:46 Audio-trans 
 +drw-r--r--    2 root     root        8.0K Feb  1 10:47 Bilder-trans 
 +drw-r--r--    2 root     root        8.0K Feb  1 13:25 System Volume Information 
 +drw-r--r--    2 root     root        8.0K Feb  1 16:46 Video-trans 
 +-rw-r--r--    1 root     root          65 Feb  1 11:21 autorun.key 
 +-rw-r--r--    1 root     root         286 Feb  1 16:44 autorun.sh 
 + 
 +</konsole>
  
 If you now plug in the stick into the router, the stick is mounted to the file system and all tasks from the "autrorun.sh" file are run. If you now plug in the stick into the router, the stick is mounted to the file system and all tasks from the "autrorun.sh" file are run.