Site Navigation:       Home       Page1       Page2       Page3       Page4       Page5       Do more       Word of Mouth       Donate

 

 

Page 2 of 5:

 

 

I like to use a combination of Putty and Webmin to administer my Linux servers. But since this how-to is about doing it all

through Webmin, we will briefly stop using Putty and install the SSH2 module for Webmin.

 

The SSH2 module is very similar to Putty. It’s not as robust, but is web based and is very convenient.

Eventually we do stop using it and switch back to Putty. Putty is much better at copy \ paste and later on

we see how Putty handles interactive questions and graphical prompts much better.

We only install the SSH2 module for the convenience of being able to do everything within Webmin.

But eventually Putty will win you over.

 

First thing we have to do is remove the current SSH module that came with Webmin and replace it

with the SSH2 module. To remove the current SSH Webmin module, click on “Webmin” in the top left corner

and choose “Webmin Configuration”

 

 

 

Next click on the icon that says “Webmin Modules”

 

 

 

 

 

Once inside the Webmin Modules page, click on the delete tab towards the top

 

 

 

 

 

 

Choose “SSH Login”  and then click on “Delete Selected Modules”

 

*Make sure you don’t accidently choose SSH Server, it’s SSH Login you want to click on

 

 

 

 

Put a checkbox in the “Remove from users and reset control settings” and then choose “Delete”

 

 

 

 

 

 

If successful, it should say the module was successfully deleted

 

 

 

 

 

That’s it, it’s uninstalled. Now we have to install the new one.

 

 

Click on “Webmin” in the top left corner and choose “Webmin Configuration” again

 

 

 

 

Click on the icon that says “Webmin Modules”

 

 

 

Make sure you’re in the “Install” tab of the webpage

 

And choose “from ftp or http URL”

 

And paste the following URL into the box to the right

 

http://www.webmin.com/download/modules/ssh2.wbm.gz

 

*Due to upgrades some versions may no longer be available, if you run into this just go to webmin.com and find the newer link

 

 

 

 

Click on “Install Module” and Webmin will go get the module file, and install it

 

If successful you should see something like this, telling you it put it in your access control list, under the category “Others”

 

 

 

 

 

Click on the “Others” category on the left menu and choose “SSH2 Login”

 

The SSH2 Module will begin to open

 

If you’re ever prompted to install Java, it’s talking about the web browser on your Windows PC, not Java for your Linux box. Just go

to http://java.com from your Windows PC and run the install if needed. If you’re using Firefox, you may need to do this after every time

you upgrade your browser.

 

 

Once you see the MindTerm logo below, you’re good to go.

 

Just hit the “enter”  key on your keyboard, and you can login using username root

 

 

 

 

 

If you still don’t see SSH2 Login, try hitting the Refresh Modules button at the bottom left, and or looking under Un-used Modules.

 

 

If you don’t like this single window view, you can click on the “Module Config” button and tell it to open in separate window.

 

 

 

 

 

 

 

Make the following changes

 

Then Click on “Save”  and the next time you launch the SSH2 Module, it will open in its own little window.

 

 

 

 

 

Here is what it will look like in separate window mode

 

 

 

Click “enter”  on your keyboard, and login as root

 

 

 

This should look familiar to you, it works almost the same as Putty.

 

When you’re done, type   logout    and press  “enter”  on your keyboard.

 

Wait 10 seconds for the logout to happen, then you can hit the “X” in the right hand corner to close the window.

 

This will be helpful when you want to run a command, that answers you back, asking a question, like “are you sure” or “hit yes to continue”

 

 

Webmin has a built-in command shell, that works awesome. And most commands have a built in –yes option that can answer some prompts.

But it doesn’t allow you to interact and answer questions the way this SSH2 Module and Putty can. Putty allows you a much wider copy\paste

range than this SSH2 module. So if you’re a copy and paste’r, you will like Putty much more  (right-click = paste in Putty)

 

Again, I would encourage you to use Putty instead of this, i really only use this when i dont have Putty installed.

 

For the next step we are going to use Webmin’s built in command shell. It’s super convenient when you don’t need to interact with the answer.

 

Click on “Others” and click on “Command Shell”

 

 

 

We are going to execute the command   mii-tool

 

Type   mii-tool     in the box and then click “Execute Command”

 

 

You should see something like this

 

 

 

The grey area is where it will show you the results of the command.

 

We need to make sure you’re getting a “full duplex” connection and not “half duplex”

 

*Note, If your following this guide using a Virtual Machine, keep reading, but this doesnt apply to you,

Virtual Machines dont have this flaw, and these errors can be ignored.

 

If yours answers back “full duplex” then you’re all set, but keep reading.

 

If it says “half duplex” and its not a virtual machine, then thats bad news, and we need to fix it.

 

If you simply got an error, that means mii-tool doesn’t support your network card, this isn’t a problem. Just run the command    ethtool eth0

 

Click on “Others” click on “Command Shell” and Execute command ethtool eth0

 

(there is a space after ethtool)

(that’s eth ZERO, not eth OH)

 

 

If it says Duplex: Full    then your good to go, but keep reading.

 

*note, If your following this guide using a Virtual Machine, you can skip any ethtool errors,

Virtual Machines dont have this flaw, and ethtool errors can be ignored, but keep reading.

 

If it says Duplex: Half   and its not a virtual machine, then we need to fix it.

 

 

If mii-tool told you that you had a half duplex connection, then the fix is to add the following line to the /etc/rc.local file

 

mii-tool –F 100baseTX-FD eth0

 

If mii-tool told you that you had a full duplex connection, or this is a Virtual Machine, then add the following line to the /etc/rc.local file

 

#mii-tool –F 100baseTX-FD eth0

 

*Note, commands that start with a "#" are ignored, your full duplex and dont have this problem, your just doing this to follow along.

 

 

If your network card isnt supported by mii-tool just use the ethtool command below instead

 

If you got an error running mii-tool, and or if ethtool eth0 told you that you had a half duplex connection, then add the following line to the /etc/rc.local file

 

ethtool –s eth0 speed 100 duplex full autoneg off

 

 

If ethtool told you that you had a full duplex connection, or this is a Virtual Machine, then add the following line to the /etc/rc.local file

 

#ethtool –s eth0 speed 100 duplex full autoneg off

 

*Note, commands that start with a "#" are ignored, your full duplex and dont have this problem, your just doing this to follow along.

 

 

Here is how to edit that file the Webmin way, using the File Manager (you’re going to like this, it makes EVERYTHING a lot easier)

 

Click on “Others” and then Click on “File Manager”

 

 

 

Click on the   etc   folder and then in the right side window, scroll down until you find the file name  rc.local

 

This file is executed at startup, so we can use it to make changes that happen every time the computer restarts.

 

Single click on the rc.local file  (do not double-click) double-click will try to download the file, that isn’t what you want.

 

Single click the file, so that it is highlighted, then using the buttons along the top, choose “Edit”

 

A new window should open, and will let you edit the contents of that file.

 

 

You should see something like this

 

 

 

You can type directly into that window

 

If mii-tool told you that you had a half duplex connection, copy and paste this

 above exit 0

 

mii-tool –F 100baseTX-FD eth0

 

 

 

You should have something like this

 

 

Click  “Save & Close”  and that’s it, the file is edited, all you need to do is reboot, I will show you how to do that on the next couple pages.

 

 

If mii-tool gave you an error and or ethtool eth0 told you that you had a half duplex connection, then edit the rc.local file   and copy\paste this instead

 

ethtool –s eth0 speed 100 duplex full autoneg off

 

 

 

Click  “Save & Close”  and that’s it, the file is edited

 

 

If you were already full duplex or a Virtual Machine, paste one of these in there so you can still follow along.

 

#mii-tool –F 100baseTX-FD eth0

#ethtool –s eth0 speed 100 duplex full autoneg off

 

We put a #   in front     so that it would ignore those lines, Linux ignores lines that start with a #

And in most cases, will ignore lines that start with a   ;

 

We dont want it to do anything if you werent having a problem, but i still wanted you to learn how to edit that file and follow along.

That file is ran everytime you reboot the computer and can be very useful.

 

Now we are going to use Webmins Bootup and Shutdown module to reboot the computer.

 

Click on “System” click on “Bootup and Shutdown” then scroll down to the bottom and click “Reboot System”

 

 

 

It will ask you if your sure, tell it to do it, then computer should reboot, at that point your screen will be un-usable while it reboots. Just wait about 5 minutes

and you should be able to use Webmin again.

 

 

Assuming the reboot went OK, you should be able to go back to the Command Shell module, run

either mii-tool or ethtool eth0 again, and see a full duplex response.

 

This type of fix doesnt stick, thats why we put it in startup and let it run every boot everytime.

 

Moving on, let’s go back to the File Manager and edit some more files.

 

Click on “Others” and then Click on “File Manager”

 

 

 

 

 

We need to disable IPv6, this how-to later on assumes you’re only using IPv4

 

Let’s edit the file /etc/modeprobe.d/aliases    (*If you’re using Ubuntu, this file may not be needed, or may be called aliases.conf)

 

(you can tell by the line above it’s a file named “aliases” inside the folder called “modprob.d” which is located inside the “etc” folder.

 

 

Change the line

 

#alias net-pf-10 ipv6

 

To

 

alias net-pf-10 off

 

Make sure you remove the # from the beginning, or Linux won’t read it.

 

Click on “Save and Close”

 

 

Next let’s edit the file /etc/modeprobe.d/blacklist    (*If you’re using Ubuntu, this file may not be needed, or may be called blacklist.conf)

 

 

 

 

Adding the line

 

blacklist ipv6

 

Click on “Save and Close”

 

 

So far we have stopped it from loading, and stopped it from coming back after upgrades.

 

We are done with disabling IPv6, and can move on to something else.

 

It is good practice to make comments in these files, of the changes you make, like

 

#Changed by Kevin, from “ipv6” to “off”

 

But since you have this how-to to refer back to, there isn’t much point in making any comments.

 

But it is a good habit to get into once you complete the how-to, and start editing files on your own.

 

This is a good time to mention a few quarks about computer names in Linux.

 

The Webmin installer probably told you that you can access your machine from    https://your – computers - name:10000           

 

And you probably found that didn’t work.

 

This isn’t a Webmin problem. Anytime you switch from DHCP to static, or switch from one static IP to another, there are a few files you need to edit. As these files are expecting to get this information from the DHCP server, but static IP’s don’t communicate back with the DHCP server.

 

/etc/hosts                      (replace 127.0.1.1  with your Linux boxes static IP address)

 

*not to be confused with 127.0.0.1 you want to edit\replace 127.0.1.1

 

 

 

Click on Save and Close

 

Then edit

/etc/hostname               (make sure it’s right)

 

 

 

 

Then edit

 

/etc/resolv.conf             (make sure your router is listed as one of the nameservers, and that it’s searching the right local domain)

 

 

 

 

Click  Save and Close

 

Reboot your Server, and the computer name should now be playing nice with your static IP address. This is just the foundation, it won’t actually come

into play until we configure Samba later on in the how-to, but you now have the right settings for using names along with static IP addresses.

 

 

Next let’s familiarize ourselves with the Upload and Download module for Webmin.

 

This isn’t a very fast way of sending \ receiving files, because of the https encryption Webmin is using. That level of encryption is an awesome thing, and it

keeps your passwords very safe from prying eyes. But inside your local network it can be a little over-kill, and will really slow you down.

 

But once we cover it, we can move on to the faster and more convenient ways, like ftp, http, and Samba file shares.

 

 

Inside of Webmin, click on “Others” and then Click on “Upload and Download”

 

 

You should see something like this

 

 

 

 

This module is pretty easy to use, just make sure you change the

 

“Download to file to directory” field to be     /options

 

 

This will make it much easier to find files that you upload \ download to the Linux box.

 

 

Let’s walk through it once, click on the “Upload to Server” tab at the top

 

 

 

 

Assuming the file you want to upload is located on your Windows PC. Just make sure to change the

“Download to file to directory” field to be     /options

 

Then browse to the file you want to upload

 

Click “Upload” and it will upload it to the /option folder on your server.

 

 

You can then browse to it using the File Manager

 

Click on “Others” and then Click on “File Manager”, and then click on “options”

 

 

 

Or if the file you want to upload to the server is located on a the web, and not on your Windows PC

 

Go back to the Upload and Download module, and choose the “Download from Web” tab instead.

They work the same way, the file will end up in your /options folder.

 

 

Just make sure to change the

“Download to file to directory” field to be     /options

 

 

And then paste the URL to the website\file you want to download

Into the “URLs to download” field

 

 

 

 

 

You won’t always know the URL to the file you want, but you should be able to right click on it from your Windows PC, choose properties,

and copy and paste the URL into the “URLs to download” field

 

 

 

Paste it into Webmins Upload and Downloads, “URLs to download” field

 

 

 

 

You probably noticed how very slow that was, that’s again due to the encryption, we will speed all that up later on in the how-to

 

Using the File Manager, you should be able to see your newly uploaded file

 

 

 

 

Let’s edit some more files

 

Let’s edit the file  /etc/ssh/sshd_config    (to limit the users who are allowed to SSH)

 

Make sure there is a “d” in there, this isn’t the same as ssh_config, you don’t want that, you want to edit  sshd_config

 

 

 

You should see something like this

 

 

 

Somewhere towards the bottom, add the following line

 

AllowUsers root wood

 

Replacing wood with whatever username you created during the install

 

 

Anyone that can SSH can browse all your folders and list all your files, so it's extremely important to limit that.

 

Basically don’t give anyone but yourself SSH access.

Don’t give anyone but yourself Webmin access

 

 

Later in the how-to we will cover rssh for users

That stands for Restricted SSH, and does work as promised.

 

Later in the how-to we will cover Usermin

This is a Webmin like interface, but can be locked down for users

 

But basically, don’t ever give someone else Webmin or SSH access, it not a good idea until you have mastered Linux and are comfortable with file

permissions and jailing home directories.

 

We will even be taking access away for root later on in the how-to. That way you’re not ever typing that password over the internet. But for now,

during the initial setup on your local network, it’s ok.

 

 

Next we are going to install the second hard-drive (the data drive) and use Webmin to mount it.

 

 

Everything in Linux is treated like a file or a folder. So when you are adding hard-drives, you go through a mounting process, which makes that drive

appear as a folder amongst the other folders on your system. This can be a little strange at first, but if you do some good planning on your folder names,

it can help with some of the confusion.

 

 

 

Let’s start by powering off the Linux box. You do this the same way you restart it using the Bootup and Shutdown module, but just choose

“Shutdown System” instead of Reboot.

 

 

 

 

This how-to assumes you know how to physically install the second hard-drive, go ahead and do that now. When you done, use the

computers power button to turn it back on.

 

Wait about 5 minutes then you should be able to get back into Webmin.

 

Using the File Manager module create a folder called   /mymounts

 

 

 

As you can probably guess by the name, this folder is going to contain drives that you have mounted. The system mounts a lot of drives and partitions for you, as well as the CD drive, Floppy drives, etc… to help avoid some of the confusion of mount points, you will know anything inside this folder is actually a separate device (hard drive or partition) that you mounted yourself, this will help refresh your memory every time you navigate to it.

 

 

The forward slash  /  just tells it to be its own folder, at the root, on the beginning of the drive, and not a subfolder of some other deeper folder.

 

 

Just make sure to choose the new folder button, and not new file, and don’t be tempted to click on mount, that isn’t want you want

 

 

 

 

You should see something like this when you’re done

 

 

 

 

Now go inside the mymounts folder and create a folder called d2p1

 

 

 

 

You should see something like this when you’re done

 

 

 

 

 

d2p1 stands for (drive two partition one)

It’s the second drive in the system, and it’s the first partition on that drive

 

So what this folder structure means is. It’s something you mounted yourself, because it’s in the mymounts folder. And it’s the second drive inside the computer, and is the first partition on that drive.

 

(If you had a second partition on the second drive, you would mount that in

/mymounts/d2p2) a third drive would be /mymounts/d3p1/ and so on…

 

 

We need to format the second hard-drive. We need to so this before mounting it, because when it’s mounted, it’s considered in use. So pre-mounting, lets format it.

 

Using the Webmin module “Partitions on Local Disks”

 

 

Click on your second hard-drive, if you have followed the how-to exactly, it will be the second one in the list  (B)

 

Click “Device B”  (assuming that is for sure your second hard-drive)

 

 

You should see something like this

 

 

 

 

Click on “Number 1”

(There should be only 1 number, if there is more than 1, click on them and delete them)

(Triple check you are on Device B though!)

 

 

 

You should see something that looks like this

 

 

Change the “Type”  to Linux

Then click Save.

This will kick you back to the main screen again, where you will have to click on device B again

 

 

Click on device B again

And next to the “Create Filesystem” button change that to Linux Native

(Linux Native = filesystem ext3 as of the date of this writing)

 

 

 

Write down your device file name, on mine its   /dev/hdb1

This stands for device ,  hard drive B  (B meaning 2nd) , 1 (meaning first partition)

 

 

 

If you have a newer computer, it will most likely list them beginning with an “S” (example sdb1)

Meaning it thinks it a SCSI or SATA disk.

 

Then click “Create Filesystem”

 

 

You should see something like this.

 

 

 

Don’t check for bad blocks, it takes way too long and the webpage will time out

 

We will talk about how to check for bad blocks later in the how-to

 

 

Then click on “Create Filesystem”

 

 

You should see something like this

 

 

 

This can take hours to finish

 

 

If it fails, just run it again.

 

If successful, you should eventually see “command complete” at the bottom of the screen.

 

 

 

Now that it’s installed and formatted, we can mount it.

 

Using the Webmin module “Disk and Network Filesystems”

 

 

 

Change the “Type” box next to the “Add mount” button to

“Linux Native Filesystem ext3”

 

 

 

 

Then click the “Add mount” button

 

 

 

 

 

You should see something like this

 

 

 

You should see something like this, Make the following changes

 

In the “Mounted As” field type     /mymounts/d2p1 

 

Change “Check Filesystem at boot” to “Check First”

 

 

In the “Other Device” field, check the button so it knows to use that field, and put the actual device name of the second hard-drive.

*If you forgot what is was, refer back to previous section.

 

On mine its   /dev/hdb1

This stands for device ,  hard drive B  (B meaning 2nd) , 1 (meaning first partition)

 

If you have a newer computer, it will most likely list them beginning with an “S” (example sdb1)

Meaning it thinks it a SCSI or SATA disk.

 

If you get confused just refer back to the previous section, it will show you how to check what your device name is.

 

 

Change Use Quotas to “User only”

 

 

 

 

If successful, you should see it listed in the next screen

 

 

 

Sometimes in this how-to I will have you do things the hard way, or the long way. When it will help you to understand some of the more confusing tasks.

 

Like for instance you probably already wondering why I didn’t have you install Putty much much earlier, so you could have copied and paste straight from this how-to. But then you wouldn’t have learned how to type them correctly.

 

You probably also saw a few options that would have made mounting easier, like this button

 

 

But then you wouldn’t have learned the \dev\  device names

 

 

Or maybe you saw this window during the format

 

 

But if you would have used that mount button, you wouldn’t have seen how to enable the Quotas.

 

 So even if you see a shortcut, try to follow the how-to exactly, because I’m going to make assumptions later on in the how-to, that certain things are already enabled. And if you skip any of these steps, you could get lost and have to start over.

 

You done with the mounting part, the second hard drive is now accessible from the File Manager module, under /mymounts/d2p1/

 

 

 

Just for practice, let’s put a file in that folder, this will be an example of putting files on your data drive  (hard drive #2)

 

Using the File Manager, copy and paste a file from the /options folder to the /mymounts/d2p1 folder

 

 

Click the file once to highlight it, then click “Copy” from the toolbar above

 

Navigate to the /mymounts/d2p1/ folder, and paste it using the “Paste” button from the toolbar above

 

 

 

If successful, you should see something like this

 

 

 

And that would be an example of saving a file to hard-drive number 2

 

 

If you ever need to un-mount it.

 

(You shouldn’t ever need to do this) except maybe to re-format it or scandisk it.

 

Just navigate back to the Disk and Network Filesystems module, and click on /mymounts/d2p1/

 

 

 

 

Check the “Save” option so it keeps a record of it, then click the “Unmount” option

 

 

 

 

Then click “Save” at the bottom, and it will un-mount the drive.

 

And because you checked the save option you can easily re-mount it by coming back to this page and choosing “Save and mount at boot” and “mount” and then click “Save” at the bottom.

 

That’s it for mounting and un-mounting. Again you shouldn’t ever need to un-mount it, but you know how if you need it.

 

 

Next let’s make sure your Linux box has the right time, and set it to automatically sync up with a time server at midnight each night.

 

Using the “System Time” module, set the time and date for both fields to be correct. You only have to do this manually once, keeping in mind that it’s a 24 hour clock.

 

 

We have to do it manually once, because the sync feature doesn’t work if the time is off by more than a couple of hours, so we do this to ensure the time is “almost” right, so the sync will work and always keep it accurate.

 

Don’t be tempted to use the “Set system time to hardware time” or the other one, just set each one manually.

 

This should work, but if you’re getting errors manually setting the time you can do it the command line way like this (using the SSH2 module)  ntpdate pool.ntp.org

 

 

Once both are set right, navigate to the “Time server sync” tab at the top right.

 

 

 

 

 

You should see something like this

 

 

 

 

Set the “Timeserver hostname or address” field to the timeserver closest to your area

1.us.pool.ntp.org

 

*If you’re having DNS issues you can use IP addresses here until you fix that.

 

Check the box that says “Set hardware time too”

 

Check the box that says “Yes, at times below”

 

Check the box that says “Simple schedule” and “Daily at midnight”

 

You can ignore all the time tables below, because you’re using the simple schedule above.

 

Click “Sync and Apply” at the bottom of the screen, and your all set

 

You should be able to navigate back to the “Set time” tab at the top, and see that it did in fact set the correct time for both fields.

 

You’re all done with setting the time.

 

*If you get errors about the hardware clock not being set, you may have to enable the following at boot time, and then reboot. Only do this if you are experiencing problems with the hardware clock.

 

Navigate to the Bootup and Shutdown module, place a checkmark next to hwclock.sh and click    Start Now and on Boot

 

 

That’s about it for the time settings.

 

Next let’s make sure your MTU is set right on your network card. You usually won’t see a problem here unless you have multiple NIC’s, but let make sure anyway.

 

Using the “Command Shell” module, run the following command

ifconfig eth0         then click  the “Execute command” button

 

 

 

You should see something like this

 

 

 

 

For most purposes your MTU should be 1500, if yours comes up right you can skip this part of the how-to.

 

It should have found the right setting for you automatically, I’ve only see it get confused when there is more than one NIC.

 

There are some DSL setups that are not 1500, you will have to Google your current situation to find your correct number. 1500 is right for LAN setups and all the major Coax Cable Modem ISP’s.

 

This is an advanced problem, but if you have exhausted all other options, here is how you can force the right setting.

 

 

Using the “File Manager” module. Edit the file /etc/network/interfaces     and make the following edits

 

 

 

up /sbin/ifconfig eth0 mtu 1500

 

 

 

 

The placement of that line is important, make sure you put it under the iface command, and make sure if you have two or more NICs that you put it on the right line for that particular NIC. (example, eth0, eth1, eth2, etc..) and of course you would change the command to reflect the NIC number  (example :  up /sbin/ifconfig ethx mtu 1500)

 

 

Again, this is a more advanced problem, make sure you have exhausted other easier fixes first.

 

 

That’s it for MTU

 

Now we are going to talk about an optional install, called   md   or     mdadm

 

md is a software RAID, Its amazingly fast but expect a slight performance loss, because in most situations it will be doing every task atleast twice.

 

 

You can install this if you want, it does work extremely well. I would just caution you to not use it unless you have a real need for it.

 

For instance, it can group many smaller hard drives together to form one big one. But if you are going to setup a bunch of folders and organize the drive, dividing the data into categories. (example: Folders such as  “movies” or “software” or "pix") you could just designate each drive for those categories, and have a movies drive, and a software drive, and a pix drive, and not have to deal with a RAID configuration at all.

 

If you looking to just combine 2 or more disks into 1 large disk, use concatenated-linear (often called JBOD  Just a Bunch Of Disks) in the RAID configuration instead of using RAID 0. But again don’t waste your time joining smaller disks if you’re going to organize the data into categories that could have fit on the single drives.

 

 

RAID 1 is nice, it’s a 2 disk setup, that is an exact copy of each other. But even with this simple convenient raid, there are many reasons to not use it. You’re adding another disk to the system, so you just doubled your chances of having a bad hard drive, so it’s almost like your preventing something you’re causing. And if you’re truly worried about backups (as you should be) you should be doing offsite backups, backups to another computer, external backups. All of these things are superior to raid, because if that computer is involved in a fire, earthquake, flood, etc… your RAID is toast. And if your system gets a virus or the files get deleted or corrupted, you’re just going to have a bunch of copies of infected or corrupted and or missing files.

 

md software raid is amazing, but don’t use it if you don’t need it, and don't use it as a backup plan.

 

Don’t get me wrong, I use RAID, I use it everyday, it’s awesome. Just don’t set it up if you’re not getting the right use out if it.

RAID 0 Used for extreme performance (Careful, there is no redundancy here, any data loss is permanent, even paid recovery professionals usually can't get this data back)

RAID 1 Most basic of raids, two exact copies (mirror, 1 can go bad)

Concatenated-Linear (joining of multiple smaller disks to make one large useable one, Careful, there is no redundancy here, but data rescue is MUCH easier here than on RAID 0)

RAID 5 Used for redundancy (3 disks, 1 can go bad)

RAID 6 Used for extreme redundancy (4 disks, 2 can go bad)

RAID 10 Used for both its performance and the fact that it is also a mirror (4 disks, 1 can go bad, 2 if your lucky which 2 it was)

 

If you have decided you want to, here is how. If not, you can skip this section.

 

 

Using the SSH2 Module, or Putty (preferred) run the following command (You really should use Putty for this, your about to see why)

 

apt-get install mdadm

 

 

 

It will probably ask you to say Y or Yes

 

The install will later pop up a GUI window asking you some questions.

 

 

 

Using your keyboard, Tab down to the word “OK” and then hit enter on your keyboard.

 

The screen will look a little fuzzy and off centered, this SSH2 module doesn’t handle these GUI pop ups very well. If your screen is totally un-useable, you can use Putty instead. But for the most part, you should be able to follow along.

 

 

Next it’s going to ask you which RAID configs you want it to start, erase ALL and type NONE. Because we are going to use Webmin to configure it.

 

 

Once you have the word none typed in there, tab down to OK and press enter on your keyboard.

 

 

 

If your cursor is giving you a hard time, it might help to type noneeeeeeeee in the field, and then backspace the extra eeeeeee until it reads just    none

Then it will ask you if you want the raid config to start automatically, tab over to YES and hit enter. This will cause an error at boot up, but its ok, it’s just telling us we haven’t configured it yet (we will do that later in Webmin)

 

 

Once you answer yes, it will take a couple minutes to setup. Then you should eventually get back to the normal SSH2 Module screen, where you can type   halt –p   to shutdown the computer.

 

 

 

Once the computer shuts off you can physically install the additional hard-drives.

 

 

 

Using the Partitions on Local Disks module, format any of the new drives to ext3, just like you did on previous section.

 

 

If the second hard-drive you install earlier in this how-to is going to be part of this RAID configuration, then you have to un-mount it first. Navigate to the Disk and Network Filesystems module and un-mount it. And this time, tell it to not remember the configuration. This will make it available for RAID.

 

 

Once you have them all physically installed, formatted, and un-mounted (if needed) then your ready to configure the RAID using Webmins “Linux RAID” module.

 

If you do not see the “Linux RAID” module under other, try hitting “Refresh Modules” at the bottom left of the screen.

 

 

 

 

 

It will look for a couple minutes

 

 

 

And the next time you click on the Hardware tab, it should be there.

 

 

 

Enable Monitoring, Enable sending notifications, Send them to your username@localhost

and click “Save”

 

 Choose a RAID configuration, in the drop down menu next to the

“Create RAID device level of”  button.

 

 

 

 

Chose whichever one will work for your situation, and click the “Create RAID device level of”  button.

 

All these RAIDs do work awesomely, I’m just saying limit your expectations down to what your hardware can handle.

 

 

You should see something like this (this is an example of Concatenated Linear)

 

We are joining a 40GB and a 20GB disk together to act like a single 60GB disk.

 

 

Set “Force initialization of RAID” to yes

 

And in the Partitions in RAID field, you have to select the participating disks. They appear to be selected, but they are not. You have to click on them with your mouse. In order to select the second disk, just hold down the control key on your keyboard when selecting the second disk.

 

Click the “Create” button, and it will create the RAID for you.

This can take a very long time. If you’re doing Terabyte disks, go to sleep :- )

 

As you can see it’s going to treat it as /dev/md0

And earlier in this how-to, you learned how to mount /dev/xxx into folders, so you already know how to mount this virtual raid into a folder for use on your system.

 

You should eventually be returned to a screen that looks like this, if it shows your correct RAID configuration, then you’re ready to format it.

 

 

 

 

 

Click on the device name, /dev/md0

 

You should see something like this.

 

 

 

Change the drop down box to ext3, and click “Create filesystem of type” button

 

 

This should take a long time, and do not be tempted to use the “Mount RAID on” button you see above. If you do that you will miss a few important options that are only available by doing it the long way that we covered earlier.

 

 

You should see something like this

 

 

 

 

Don’t chose check for bad blocks, it will take forever, and the webpage could time out.

 

 

If successful, you should see something like this

 

 

 

 

You just have to mount it now, as Linux ext3, using the “Disk and Network Filesystems” module like you did earlier.

 

A good folder name to use would be   /mymounts/vraid 

That name lets you know you mounted it, and that it’s a virtual or fake raid.

 

You want to use the “File Manager” module to create that /mymounts/vraid folder first, before you attempt to mount

it using the “Disk and Network Filesystems” module.

 

 

 

 

Here is what it should look like, make the following changes.

 

 

Then hit the “Create” button

 

If successful, it will look like this, and be accessible as a folder in /mymounts/vraid with almost 60GB free space

(40GB harddrive + 20GB harddrive)

 

 

 

 

This is a very small example, I have done multiple Terabyte raids, and they work great. Just make sure you really need it, and are getting a good use out of it.

 

For those of you that skipped to this page, I created a new data drive, in a RAID configuration. I’m no longer using /mymounts/d2p1  as my data drive.

 

I’m using my virtual raid setup of   /mymounts/vraid

 

The how-to will continue to reference the /mymounts/vraid folder as my data drive. Whereas on your system, if you skipped the raid how-to, you will need to be thinking /mymounts/d2p1/

 

This shouldn’t interrupt the flow of the how-to, we are still talking about that same thing, a folder, that is really a second hard drive mount point, that contains our data.

 

That’s it for the data drive, now let’s configure the web server (Apache)

The web server is already running and functioning, if you type the IP address of your Linux box into a browser window, you should see it displaying something like this.

 

 

 

By default the web server listens in folder  /var/www/   and looks for a file called index.html

 

There is already a file called index.html in that folder, that file has the words “It works!”

Inside of it, that’s why you see that on your screen.

 

 

If you were to delete that file, and replace it with your own index.html file, it would display that instead.

 

So let’s use the File Manager module to delete the contents of the /var/www/  so we can replace it with our own index.html file, for our own custom website.

 

 

 

Next you need to create your own index.html file. There are countless ways to do this, in this how-to we are going to use Microsoft Excel to make the webpage file and save it as filename index.html. But if you Google html editor, you will find millions of other ways to achieve this.

 

Launch Excel, and put some words and colors on there.

 

 

 

 

Choose “File”  “Webpage Preview” to see a preview of what it will look like.

 

Then if you like it, choose “File” “Save as Webpage” when you done

 

 

 

 

And save it as file name   index.html

 

 

 

 

Now using Webmin’s Upload and Download module, upload that index.html file to the /var/www/  directory.

 

 

 

Click on the “Upload to server” tab

 

Change the “File or directory to upload to”  /var/www/

 

Then click the “Browse” button

 

 

 Then browse your Windows PC for that index.html file you created. And choose “Open”

 

 

 

 

Then click the “Upload”  button

 

 

 

That’s it, it will upload the file to the directory, Apache is listening in that folder, and will read that file the next time you visit your website.

 

To see it, just open a browser window and type your IP address again, and viola, your own custom webpage running on your very own web server, for free.

 

 

 

 

If you didn’t want a webpage showing, but instead wanted a file chooser type of view, you could delete the index.html file, and any files you uploaded to the /var/www/ folder would show up in a download like view, like this.

 

This way your users can see what files you have available for download, and can download and navigate just by clicking on them.

 

 

------------------------------------------------------------------------------------------------------------

 

Which looks like this from your File Manager view

 

 

 

 

Or, you could have both a webpage and the file download view by making a deeper subfolder called “files” and putting the files you want available for download in there.

 

 

Just put your index.html file back in /var/www/

 

 

So when people go to your IP address, they see your webpage file

 

 

 

 

But when they go to you IP address /files (http://192.168.2.1/files) they see this 

 

 

 

Which would look like this from your File Manager view

 

 

 

 That’s pretty much it for a basic Apache web server setup, it works right out of the box. If you want to be able to setup passwords, so that people cannot get to certain websites or folders without a password, here is how.

 

We are going to install the “Protected Web Directories” module from Webmin.com

 

Go to http://webmin.com/standard.html  from your Windows PC, and look for the module.

 

 

 

 

Right click on the link that says    htaccess-htpasswd.wbm.gz     and choose “Properties”

 

 

 

 

 

This will give you the URL you need

 

 

 

 

 

Highlight and Copy that URL

 

 

 

 

 

Now go to the Webmin Configuration module

 

 

 

 

Double-Click  “Webmin Modules”

 

 

 

 

Make sure you’re in the “Install” tab of the module page.

 

And choose “from ftp or http URL”

 

And paste the following URL into the box to the right

 

http://download.webmin.com/download/modules/htaccess-htpasswd.wbm.gz

 

 

*Due to upgrades some versions may no longer be available, if you run into this just go to webmin.com and find the newer link.

 

 

 

Click on “Install Module” and Webmin will go get the module file, and install it

 

If successful you should see something like this, telling you it put it in your access control list, under the category “Others”

 

 

 

 

Click on it, you should see something like this

 

 

 

But we aren’t ready to use it just yet.

 

We have to make a change to our Apache configuration file, before it will allow password files to be used.

 

 

Using the File Manager module, edit the following file.

 

 

/etc/apache2/sites-available/default

 

 

 

 

Change the following two lines from AllowOverride None to

AllowOverride AuthConfig

 

 

Click the Save and Close button.

 

 

Then use the Bootup and Shutdown module to restart Apache  (called apache2)

 

 

 

 

Click    Restart

 

 

*Advanced* If you know you’re not going to use apple-talk on your network, you can disable it on this page

By putting a checkmark next to   netatalk    and choose    Disable Now and On Boot

 

 

If you know you don’t need it, this will speed up the boot time and free up some resources

 

 

Once it’s been restarted, navigate back to the Protected Web Directories module

 

 

 

 

 

And click on  “Add protection for a new directory”

 

 

Directory meaning folder

 

 

In this example we will password protect the files folder on your website

 

 

 

 

After you click on “Add protection for a new directory”

 

You should see something like this, make the following changes.

 

 

 

 

In the Directory path type     /var/www/files

 

Because that is the directory we are wanting to password protect

 

Set the File containing users button to     selected file

 

In the selected file field type    /options/.htpasswd-4-var-www-files

 

Notice there is a dot in that filename. That’s important, it means hidden.

 

It’s going to create this file for you, but it won’t create folders for you. So make sure your specifying a directory that already exists, like /options

 

 

 

In the Authentication realm type     Restricted Area

 

Usually you would name the file containing user’s    .htpasswd

 

That’s the industry standard.

 

 

But we named it      .htpasswd-4-var-www-files

 

Or

 

/options/.htpasswd-4-var-www-files

 

Meaning to me, it’s in the /options folder

 

 

 

I like to name it more descriptive then just .htpasswd, because I tend to have three or four of these files protecting different directories and with different passwords.   

 

 

In Linux the leading period or dot in front of a filename means it’s a hidden file

 

So when I see the filename    .htpasswd-4-var-www-files   we know it’s a hidden password file, protecting the folder /var/www/files

 

So if I were going to protect a second folder, something like

/var/www/photos/wedding

 

I would name the file containing users .htpasswd-4-var-www-photos-wedding

 

Or   /options/.htpasswd-4-var-www-photos-wedding

 

Meaning the answer to the password for that directory is in the /options folder

 

 

Once you have it all filled out, click the create button

 

 

 

 

 

If successful, you should see something like this

 

 

 

So the structure is all there, now you just have to add usernames and passwords to it.

 

Click on  “Add a new user”

 

 

You should see something like this

 

 

 

 

 

Here you can add as many usernames and passwords that you want. These aren’t real accounts on your server. You can make something up here, these are just password prompts on your websites.

 

For instance, maybe you had family photos in that files folder, and you only wanted your family members and your friend Ed to see them. You could add a username and password like

 

Username:    my

Password:     family

 

And another one like

 

Username:    ed

Password:     12345

 

Whenever someone tries to your website, it works just fine.

 

 

 

 

 

But if they try to go any deeper into your website, or are sent a deeper link.

like /files.  Then they are prompted for a password

 

 

 

 

 

 

 

And if they enter the right username and password here, they will be able to see the files inside the files folder (directory)

It’s a good idea to use made-up usernames and passwords for these websites. By made-up I mean not actual usernames and passwords that you’re using as accounts on the server.

 

 

These website passwords are sent over the network and internet in plain text, meaning it’s easy for a hacker to see the username and password that you’re typing, so don’t use a username and password here that actually has an account on the server.

 

This isn’t a huge deal because (at this point) you shouldn’t be exposing files to the internet that you don’t want people to see. Not over an http website anyway. If you're doing really private information make sure you’re using the Webmin File Manager module, or something else that uses ssl (https) or ssh.

 

You’re not going to provide Webmin access to your users, so later on in the how-to we will cover how to allow your users to securely transfer files using https. The “s” stands for secure and will secure the transfer using ssl.

 

These http (non “s”) website passwords above will keep 95% of people out, but you would be putting yourself at a huge risk if you put anything confidential on a non http’s” website. And as a rule of thumb, don’t expose anything confidential to the internet. And never type your password on a website that isn’t https. And never type your password on a website you don’t know, trust, and recognize. Without the “s” your sending them in plain text. So a hacker would see your typing just as you see the words in this sentence.

 

Later on we will cover how to do it securely, but at this point don’t put any confidential files on your web server, and don’t type usernames and passwords that matter, over a non http’s” connection.

 

No worries about Webmin and Putty, they are safe, I’m mainly talking about http and ftp sites.

 

And if you ever want to remove the passwords permanently, you can use the Protected Web Directories module, and click the “Un-protect and Remove Files” button

 

 

 

 

Apache is very powerful and can do a million more things. Later on in this how-to we will change its listening directory from /var/www/ to our data drive, so that files on our data drive can be accessible over the web.

 

Later on in this how-to we will also create users whose home directories are on the data drive, so they will be able to upload and download their files, over the web, all residing on the data drive.

 

You can probably see where this is going. Your users will have a home directory on the web. Often referred to as web space. But with a lot more functionality. They will be able to FTP, build websites, use the secure https File Manager, change their passwords, see graphs on how much space is available, have disk space Quotas, etc… all over a webpage.

 

                                                                                                           Continue to Page 3 >


Site Navigation:       Home       Page1       Page2       Page3       Page4       Page5       Do more       Word of Mouth       Donate