Ubuntu Server and Webmin NAS File Server

From LinuxMCE
Revision as of 20:14, 22 December 2009 by Ray N (Talk | contribs)

Jump to: navigation, search

Why a Webmin/*buntu based NAS?

There are a lot options to make your own fileserver for use with LinuxMCE. Many people use FreeNAS to set up great little NAS servers for use with LinuxMCE. However, there are several advantages of using Webmin to administer your own NAS fileserver:

  • Installs over top of Ubuntu Server, Ubuntu, Kubuntu and Xubuntu easily. This means that it can run transparently on you Ubuntu desktop computer for example. In my usage, I have installed webmin over a Kubuntu-8.10 computer, which also doubles as my development builder. This isn't possible with FreeNAS.
  • FreeNAS throughput has been shown in many tests to have lower throughput than other NAS servers (this includes Ubuntu installtions running Webmin)
  • Webmin has a nice, web-based interface to do pretty much anything you need on a Linux server
  • Webmin also lets your run other server software easily, such as Apache, MySQL, etc.


How to Install

The first thing you must do, obviously, is decide what you are going to install Webmin on. It will run well on all flavors of Ubuntu. For the lightest installation possible, install webmin on Ubuntu Server.

1)Install your base Ubuntu Server (or preferred flavor of Ubuntu)onto your PC

2) Go to the Webmin website [www.webmin.com] and download the latest .deb installer file.

3) Install the webmin .deb package. If you are using Ubuntu Server and have no GUI, you can do this from the command prompt. For example:

sudo dpkg -i webmin_1.490_all.deb

4) Congratulations, you're finished installing Webmin and its now ready to set up!


Setting Up Your Webmin NAS

First, install the software we will need to have a fully functioning NAS server.

sudo apt-get install openssh-server mdadm perl openssl samba


Webmin is a web-based server management system, so you will need access to a web browser on the same network as your new Webmin machine (or a web browser on the Webmin machine its self). YOu will need to know the IP address of your Webmin box.

In your web browser, navigate to <your_ip_address>:10000. On my installtion for example, this ended up being:

192.168.80.200:10000

You will be brought to a page explaing that SSL is enabled. Click on the link provided to go to the SSL encrypted management site. It is normal if you get some warnings about teh SSL certificate. Acknowledge the warnings and add an exemption if you would like.

Next you will be brought to a login page. Login with the credentials you used when you installed Ubuntu Server. Once you do, you should be in the Webmin web interface.

Configuring Your NAS

Now its time to add drives, software raid them if you want, etc. I will cover setting up a software raid, and how to share those drives (sharing a single drive is very similar)

  • First, on the left pane, navigate to Hardware->Linux RAID if you want to set up a software RAID.

Use the "Create RAID device of level" button in combination with the dropdown to create a software RAID. You will see it appear at the top of the screen. CLick on the new RAID device, and you will be at a screen where you can format the new RAID if you choose.

  • Next, we have to mount the disks that you want to store files on (including any RAIDs that you set up. Navigate to System->Disk and Network filesystems.

Use the "Mount" button in combination with the "Type" drowpdown to mount each disk (or RAID) that you want. I personally prefer to mount my devices in /media (my software RAID, /dev/md0 for example, was mounted as /media/md0). But this choice is up to you. Make sure you look the options over well!

  • Follow the above steps any time you want to add more drives/RAID arrays in the future.
  • The last part is to share the drives/RAID arrays with Samba. Navigate to Servers->Samba Windows File Sharing.

Click on "Create a new file share". Give it a name (I name mine Media 1, Media 2, and so on - but you can name them whatever you want). For "Directory To Share", you just enter the mount point for the drive/RAID array that you set up earlier (in my case, that was /media/md0). Creat with Owner and group fields should be set to "root", and the Available and Browsable radio buttons set to yes. You can now hit the "Create" button. Do this for each drive that you want to make available as a share!

  • Drill down to each share that you created. At the bottom of the screen, click on the "Security and Access Control" icon. Use the settings: Writable: Yes, Guest Access: None, Guest Unix User: root and then hit save. Next click on the "File Permissions" icon. Use the following settings and then click save:

New Unix File Mode: 755, New Unix Directory Mode: 755, FOrce Unix User: root, Can Delete Read-Only Files: yes

  • Navigate back to the Samba Windows File Sharing main page. At the bottom of the page, use the "Convert Unix users to Samba users" icon to make some samba users from the users on your linux installation. Once you have done that, you can use the "Edit Samba users and passwords" icon to set up the passwords for the users (or require no password at all). These are the usernames/passwords you will need when you tell LinuxMCE about the share!
  • Lastly, lets set things up so that the share is not only available to LinuxMCE, but protected from unauthorized use. From the Servers->Samba Windows File Sharing page and click on the Windows Networking icon. Change the "Security" option to "User Level" and save the settings. (this part only needs to be done once)


[1] shows you how to add the shares to LMCE if for some reason they don't auto-detect. Remember to add the username and password!