+ All Categories
Home > Documents > Debian Howto Start to Finish Using Webmin

Debian Howto Start to Finish Using Webmin

Date post: 10-Apr-2018
Category:
Upload: moon5397
View: 227 times
Download: 0 times
Share this document with a friend

of 679

Transcript
  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    1/678

    Page1

    Version 3.84

    Are you using the most current version of this how-to? Version numbers are located at the top right of this page.

    Latest versions are available at my homepage http://woodel.com

    Setting up a Linux Server, Start to Finish, using Webmin. By Kevin Elwood

    This how-to assumes your looking to setup a Linux Server, not a Linux Desktop. For use without a keyboard, mouse, or GUI

    interface. After setup completes you will be remotely managing it, and will not have a need for the monitor and keyboard onceyou have finished the initial setup. This how-to also assumes you are connected to the internet, and have at least (2) computerson the same network. It also assumes you will have at least (2) hard-drives in the server, one for the O.S. and one for the data.Only one network card is needed until the optional \ advanced section.

    For every download link, I offer an alternative source (from my server) so that you may follow this how-to exactly, down to thesame versions I used. Newer is better, and youre encouraged to upgrade after you complete this how-to. But for continuity andflow, I provide a link to the same exact versions used in this how-to. Also due to upgrades some versions may no longer beavailable, if you run into this just use the links to my server, this will ensure matching print screens, or go to webmin.com and findthe newer link.

    This how-to covers everything from the most basic setup, to a full blown server. You can choose how far to go in this step by stephow-to, even setting your Linux box up as your Router, Samba FileServer, Firewall, DNS, HTTP, HTTPS, FTP, VMWare Server,backup solution, and more.

    No table-of-contents, it is assumed you will follow this how-to, step by step, as each page builds off the previous ones. If you skipa page, you could miss an installer or file called for later in the how-to. I hope you will find this how-to helpful. I will try my best torespond via email at [email protected] if you have questions, I will try my best to respond to all of them, butplease try my BLOG first. With any luck that will turn into a knowledge base.

    My stuff will always be free for personal use, but if you would still like to contribute, you can donate money towards this, or oneof my other how-to's

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    2/678

    Page2

    *Special thanks to:

    Bill M., Mike J., Julio C., NathanR., Tim R., James M., Melissa E., Peter B., ggaron, till, sammydee, Mad Professor,AdamLis, Mihai Marinof, Lani78, Jordan Sissel, Jerome1232, Drdos2006, and of course Jamie Cameron (Webmin\ Usermin)Putty, Cobian Backup, Debian Linux, Ubuntu Linux,Ubuntuforums.org, and the millions of people that make it possible.

    - OK... Lets begin

    Although this guide was created using Debian, it will also help Ubuntu users. You will run into some problems with Ubuntus firewall(UFW) and Ubuntus Network Manager. Ubuntus local email and the way Ubuntu restarts services. Ubuntu uses vi not vim. Butthese arent major problems, the work a rounds and differences are fairly minor, you can email me or read my blog for help. For astep-by-step install, please use Debian.

    Start by downloading and burning the latest stable Debian .iso from

    http://www.debian.org/CD/http-ftp/

    Or from my sever(32 bit)

    http://t3.woodel.com/my-linux-how-to/debian-503-i386-CD-1.iso

    (64 bit)

    http://t3.woodel.com/my-linux-how-to/debian-503-amd64-CD-1.iso

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    3/678

    Page3

    * You only need CD #1 , if there is more than one to choose from

    *Due to upgrades some versions may no longer be available, if you run into this just use the links to my server, this will ensurematching print screens. Or go to debian.org and find the newer link.

    Before you begin the install Remove any unwanted \ unneeded hardware. Such as zip drives, sound cards, etc

    Disable any useless BIOS options, such as com ports, integrated sound cards, etcDisable any Keyboard or Mouse warnings

    Disable any power management features

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    4/678

    Page4

    If your BIOS has an OS option, choose Other

    Remove all hard drives except the one youre planning on being the OS drive. This will ensure you do not format the wrong drive, andhelp make this how-to a little smaller and easier to follow.

    It is assumed you only have one network card at this point. If you have more than one, you may want to remove or disable them. Thesecond NIC wont be used until the optional \ advanced sections, and can interfere with the eth numbering and firewall setup preoptional \ advanced section.

    Boot the computer off the Debian install CD, and choose Install

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    5/678

    Page5

    Do not choose Graphical Install you dont want that, just choose Install.

    Everything in this how-to is case sensitive, so if I use lower-case, then use lower-case.If you see something in capital letters, make sure to use capitals.Basically copy it exactly as you see it.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    6/678

    Page6

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    7/678

    Page7

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    8/678

    Page8

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    9/678

    Page9

    Choose a unique name for the computer, I did deb32server1To me that means, Debian, 32bit, Server, first one of several

    Think of it as your computers first name, and on the next page we will set the last name.

    You can make something up, we will be referring to this computer by its IP address anyway

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    10/678

    Page10

    So the name is somewhat meaningless, as long as the name is unique, so that you dont have a same name conflict with anothercomputer on your network.

    You can even use deb32server1 just like I did

    This is private to your network, it doesnt matter if you copy me exactly. It may even help make the how-to a little easier to follow.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    11/678

    Page11

    Choose a domain name for the computer, I did diy.lan

    Which to me means, Do It Yourself . Local Area Network

    You can make something up. Its almost like a last name for your computers.Its totally private to your network. But just like your family, youre going to want to have all the same last name on all yourcomputers.

    Which makes this computers full name deb32server1.diy.lan

    Which to me means

    Debian, 32bit, Server, first one of several, on a custom do it yourself Local Network

    We will be referring to this computer by its IP address for now anyway, so this isnt too important at this point.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    12/678

    Page12

    Much later on in the how-to, when we setup a Local Dynamic DNS server(which is optional and advanced) you might find it easier to follow the how-to, if you also use diy.lan

    It doesnt have to end with .lan you could make something up.I just think it will help the flow of the how-to if you chose something ending in .lan

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    13/678

    Page13

    Choose your time zone

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    14/678

    Page14

    Choose Guided use entire disk

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    15/678

    Page15

    If you removed all the other hard-drives pre install, you should only see one option here.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    16/678

    Page16

    Choose All files in one partition

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    17/678

    Page17

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    18/678

    Page18

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    19/678

    Page19

    Choose a password for the account named root (choose a very strong password here)

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    20/678

    Page20

    Created a second user, so you dont always have to login as root.

    Here I used the name wood

    You can use anything you want

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    21/678

    Page21

    I like to keep the username the same as the full name, this can help avoid confusion later on.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    22/678

    Page22

    Choose a password for the account you just created(Choose a very strong password here, this user will have more rights than a normal user)

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    23/678

    Page23

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    24/678

    Page24

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    25/678

    Page25

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    26/678

    Page26

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    27/678

    Page27

    You should be able to leave this blank, and click ContinueIf you have a proxy, chances are you would know what to do here anyway.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    28/678

    Page28

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    29/678

    Page29

    Using the Space bar on your keyboard, un-check Desktop environment.

    Make sure to un-check everything. With the exception ofStandard system

    We will install most of these things later in the how-to, dont be tempted to click on them now. And most importantly, do not chooseDesktop environment. This is a server how-to, not a desktop how-to.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    30/678

    Page30

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    31/678

    Page31

    Remove the CD, and press Continue

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    32/678

    Page32

    Did you see this screen? If not you probably didnt remove the CD.Make sure you are not booting off the CD anymore.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    33/678

    Page33

    If everything goes right, you should get a lot of text on the screen and finally a login prompt like this one.

    Please ignore that mine says debian-1 at the bottom left. I am just at a different computer today.

    If you were expecting that to say; deb32server1 login : you are rightI am just at a different computer today.

    Your screen will say your computer name, followed by a login prompt

    This wont interrupt the flow of anything at this point

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    34/678

    Page34

    Login as username root with the password you specified during setup.*Note, if you cant login as root, login as your username, and type sudo before every command

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    35/678

    Page35

    Type vim /etc/apt/sources.list*Note, if you get an error, some versions of Linux might want you to type vi instead of vim

    Then hit the Enter key on your keyboard

    (there is always a space after vim)

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    36/678

    Page36

    * If you dont see anything on the screen (the contents of that file) then you typed something wrong.** When you see the screen above, you know you typed it correctly

    Press the insert key on your keyboard to allow you to type inside the file

    Use the #symbol to comment out un-wanted lines

    Comment out any lines that have cdrom in them

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    37/678

    Page37

    When you are finished press the Esc key on your keyboard, this will take you out of insert mode and should move your cursor to the

    bottom left of the screen

    Then press the : key

    You should see this symbol on the bottom left of your screen

    Then type wq!

    So that it reads :wq! In the bottom left corner of the screen

    Then press the enter key

    It should then save the changes to that file, and exit you back to the command prompt.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    38/678

    Page38

    It will say something like filename written

    You wont need to use that vim editor very often after we complete the setup. But if youre stuck

    on it and cant get it to work. Do a Google search on Linux vi editor there should be somegood examples that will help you on the previous page. Only if youre stuck.

    What that did was tell the computer to not use the CD when looking for software.

    Now run apt-get update so it will both realize your cd-rom changes, and go look on the internet for the newest softwaresources. This only looks for new sources, it doesnt actually go get them.

    (there is always a space after apt-get)

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    39/678

    Page39

    As long as youre connected to the internet, you should see something like this.

    This next step is optional. After an apt-get update you will almost always want todo an apt-get upgrade

    Thats the command that actually goes out and installs the newest versions. But if you want your screens to match mine exactly, youmight want to hold off on this step until your further into the setup and more comfortable with the screens.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    40/678

    Page40

    I will leave this as optional right now, and rest assured we will perform one later.Newer is better, but doing it now could put you at a version that doesnt match this how-to. Pick your poison :- )

    If you have chosen to upgrade now, here is how.

    Type apt-get upgrade and it will go get any approved updates that are availablefor your computer.

    (there is always a space after apt-get)

    If it finds something, you will probably be asked to type Y or YES and hit enter.

    Either way, youre ready for the next page.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    41/678

    Page41

    Now we are going to install some packages (software)

    Type apt-get install samba smbfs ssh dhcp3-server openssl dnsutils apt-show-versions

    (there is always a space after apt-get)(there is a space between each installer above)(this is the hard-way, later on in the how-to we will get into copying and pasting)

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    42/678

    Page42

    Type it word for word

    Its going to tell you that you need some additional installers, and it will prompt you to go get them.When asked make sure you type Y for yes and hit enter.

    *note, you do not have to specify whether you want 64 or 32 bit installers, apt-get will decide for you based on your system. This is anexcellent feature.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    43/678

    Page43

    The install of Samba is going to ask you a few questions on screen. A GUI box will come up, without any mouse support. So use the

    TAB key on your keyboard to move around it, and the enter key to choose things like next, continue, and OK.

    Enter the same name you did earlier

    Im going to use diy.lan

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    44/678

    Page44

    Choose Yes to this

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    45/678

    Page45

    The DHCP server software will warn you that its being installed as non-authorative. This is fine. You will also get a warning duringreboots that DHCP Server failed to start. This isn't an error and can be ignored it wont actually load unless we tell it to, so ignore anythoughts you might have about this for now. We will come back to it much later in the how-to.

    You are almost ready to remove the keyboard and the monitor. We just need to set a static IP address(or reserve a DHCP one)

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    46/678

    Page46

    If you type ifconfig and hit enter, it will show your current eth0 (Ethernet) IP address(inet addr) as well as your MAC address (HWadrr)

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    47/678

    Page47

    You should see something like this.

    If youre familiar with setting up DHCP reservations from your router, you just need the MAC address

    and you will know what to do from here.

    If youre not familiar with how to do that and just want to set a local static IP address, here is how.Note, later on in this how-to its assumed you have a static IP address, so you may want to setup a static address, even if you knowhow to do DHCP reservations.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    48/678

    Page48

    First chose an IP address that isnt part of your DHCP scope. For example, if your router is handing out IP addresses in a pool of192.168.2.2 through -192.168.2.100 then you wouldnt want to use any of those available 98 addresss in that pool (.2 through .100)

    But you could safely choose anything above that pool, such as 192.168.2.101, 192.168.2.102, etcjust as long as it isnt in the range of the available IP addresses to the DHCP server pool of addresses.

    If you dont know how to check what IP range your router is handing out, just add 100 to the IP address you currently have. This issloppy, but will most likely work. For example, if you automatically got an IP address of 192.168.2.72 its probably safe to set a staticaddress of 192.168.2.172, as most address pools are not larger than 100 (100 higher than what you currently have) This is sloppy, butshould work

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    49/678

    Page49

    If this all sounds French to you. Giving this a lot of extra thought can help with future problems, for example on my network anythingabove a .100 address means its a server or printer of some kind. Anything above .200 means its wireless. Setting up meaning to thesecan be of great importance later on, as your network starts to grow.

    If all those numbers look French to you, just remember to make sure you give your Linux box an IP address that is on your samenetwork. For example

    If youre on a 192.168.2.xxx network

    address 192.168.2.111 (replace 111 with the IP address you want)netmask 255.255.255.0

    network 192.168.2.0broadcast 192.168.2.255gateway 192.168.2.1

    If youre on a 192.168.1.xxx network

    address 192.168.1.111 (replace 111 with the IP address you want)netmask 255.255.255.0network 192.168.1.0broadcast 192.168.1.255gateway 192.168.1.1

    If youre on a 192.168.0.xxx network

    address 192.168.0.111 (replace 111 with the IP address you want)netmask 255.255.255.0network 192.168.0.0broadcast 192.168.0.255gateway 192.168.0.1

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    50/678

    Page50

    If youre on a 10.10.10.xxx network

    address 10.10.10.111 (replace 111 with the IP address you want)

    netmask 255.255.255.0network 10.10.10.0broadcast 10.10.10.255gateway 10.10.10.1

    To enter a static IP address type vim /etc/network/interfaces(there is a space after vim)

    Y h ld thi lik thi

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    51/678

    Page51

    You should see something like this

    Find the area that saysiface eth0 inet dhcp

    Hit the insert button on your keyboard. Change it to say static instead of dhcp and add the following lines

    iface eth0 inet staticaddress 192.168.2.111 (the IP address you want)netmask 255.255.255.0network 192.168.2.0broadcast 192.168.2.255gateway 192.168.2.1

    Th t it j t h t t ll th dit t it

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    52/678

    Page52

    Thats it, you just have to tell the editor to save it

    Press esc on your keyboard, this should drop your cursor to the bottom left of the screen.

    Type :wq!

    Press enter on your keyboard

    If you did it correctly it should say something like filename written

    And return you to the command prompt.

    Once you are back at the command prompt, type reboot and hit enter on your keyboard.

    Your system should reboot, and load up the new ip address.

    After you login again as username root type ifconfig and make sure eth0 is getting

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    53/678

    Page53

    After you login again as username root , type ifconfig and make sure eth0 is gettingthe IP address you specified.

    Now go to different computer, running Windows, and make sure you can ping that IP address.Type ping 192.168.2.111 (or whatever IP address you gave it)

    If youre not familiar with ping on a Windows machine Just click on the start button

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    54/678

    Page54

    If you re not familiar with ping on a Windows machine. Just click on the start button

    and type cmd

    In the black DOS like window, type ping 192.168.2.111

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    55/678

    Page55

    Make sure it replies back from the IP youre pinging. If it comes back saying something likeDestination Unreachable go back and figure out whats wrong.

    Look for typosMaybe your network card is eth1, and not eth0Dont continue with the how-to until it replies.

    Now go back to the Linux box, and make sure youre connected to the internettry to ping www.google.com

    It should reply back something like this, the numbers dont really matter, just make sure its replying.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    56/678

    Page56

    p y g , y , j p y g

    You can hit control + c on your keyboard to make it stop pinging

    Thats the Ctrl key and the C key, hold down Ctrl and press the C key

    If it replies, youre connected to the internet

    If it doesnt reply, check your internet connection.

    Make sure in your /etc/network/interfaces file, the IP address of your gateway is the same IP address as your router.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    57/678

    Page57

    y y g y y

    If you have checked everything, and determined you are having a DNS issue.

    And that your Linux box is the only computer having this issue

    You can edit the file /etc/resolv.conf by typingvim /etc/resolv.conf

    And add some name servers

    You should see something like this

    I got these numbers from dyndns.orghttp://www.dyndns.com/services/dynguide/readme.html

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    58/678

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    59/678

    Page59

    Look towards the bottom, for DNS servers, and use those IP addresses as

    your nameservers in /etc/resolv.conf

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    60/678

    Page60

    Once you can ping your Linux box, and your Linux box can ping www.google.com

    You can go back over to your Linux box and shutdown by typing halt p

    It will turn off, and you can remove the monitor and keyboard.

    You may want to just remove the keyboard, and leave the monitor plugged in for now. So you can watch it power on \ boot up thefirst time, and make sure your computer isnt complaining that it cant find the keyboard. If it complains about the keyboard, go into

    your BIOS and tell it not to warn about missing keyboards or mice.

    Once you sure it will boot up without a keyboard, you can go ahead and remove the monitor.

    Fight any temptation to plug the monitor and keyboard back in. doing so will hurt your learning experience, as its no longer needed.We will be accessing and managing the computer remotely from here on. So the rest of this how to will be completed remotely, usinga Windows computer.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    61/678

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    62/678

    Page62

    Everything else is already configured correctly, just enter the IP address of the Linux box and click Open

    The very first time you connect, it will ask you if you want it to remember that you trust this computer you can say yes.

    If successful you should get a black box asking you to login. Login as username root.(We will continue to use root until the setup is complete)

    You should see something like this

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    63/678

    Page63

    Once logged in, type or copy and paste the following commands

    To paste into Putty Window, all you have to do is right-click

    Once it is pasted into the Putty window, press the enter key on your keyboard. Your Linux box will now go out to the internet anddownload \ install those software packages above.Say yes if prompted.

    Paste in the following command, then press enter.

    apt-get install apache2 vsftpd quota bind9 perl libnet-ssleay-perl

    Paste in the following command, then press enter.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    64/678

    Page64

    apt-get install libauthen-pam-perl libpam-runtime rssh libio-pty-perl

    Paste in the following command, then press enter.

    apt-get install libmd5-perl etherwake ntpdate libio-socket-ssl-perl

    Paste in the following command, then press enter.

    apt-get install monit fail2ban libapt-pkg-perl ethtool exim4

    This should take awhile to complete, after it finishes

    Type the following command

    mkdir /options and hit enter on your keyboard

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    65/678

    Page65

    This stands for make directory and will make a folder called options on the root of the hard drive.We are going to use this folder to download the webmin installer into.

    Type cd /options and hit enter on your keyboard

    This will put you into the options folder

    Next we will use the wget command to download the webmin installer.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    66/678

    Page66

    gwget + the full path to the location of a website file, will download that file

    Type or paste wget http://prdownloads.sourceforge.net/webadmin/webmin_1.520_all.deb

    and hit enter on your keyboard.

    (there is a space after wget)

    Or from my serverwget http://t3.woodel.com/my-linux-how-to/webmin_1.520_all.deb

    *Due to upgrades some versions may no longer be available, if you run into this just use the links to my serverthis will ensure matching print screens, or go to webmin.com and find the newer link by right-clicking the download link, and viewingits properties.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    67/678

    Page67

    Once you have the http path to the Webmin installer, type wget http://xxxxxxxxxxxxxxxxxxx and hit enter

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    68/678

    Page68

    You should see it start to download the file, and will show you the download progress.

    You should see something like this

    It will download it to the current folder that youre in, so it just downloaded it to the /options folder

    When it finishes downloading, type dpkg i webmin_1.520_all.deb and hit enter on your keyboard.

    Or dpkg i /options/webmin_1.520_all.deb or dpkg i /options/webmin_x.xxx_all.deb if newer version

    That stands for Debian Package Install, and will install the Webmin program packaged for Debian.

    If it tells you youre missing something, just typeapt-get install those-things-it-says-your-missing and hit enter on your keyboard.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    69/678

    Page69

    It will remember you were trying to install Webmin, and will finish installing it after any missing packagesare installed. You should now have Webmin installed, and can exit out of Putty

    by typing exit or logout

    To login to Webmin, open Internet Explorer or Firefox and type your IP address, followed by :10000proceeded by https://

    https://the-ipaddress-of your-linux-box:10000

    For example if your Linux box IP address is 192.168.2.172 you would typehttps://192.168.2.172:10000

    *Note, If you have been following along, you probably expect my IP address to be 192.168.2.111or 192.168.2.172 (your right)Im just at a different office and server today.

    In the example below, this Linux box is now 192.168.2.1 so I need to typehttps://192.168.2.1:10000

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    70/678

    Page70

    You would type the same thing, but with your IP address instead.

    You will probably get a warning telling you not to trust the webpage. You can ignore this, its completely secure. Its just your using aself signed ssl certificate, and not a paid one. This is still completely secure from within your internal network.

    If you have problems with this later on, switch to Firefox. With Firefox you can choose to save the certificate so youre not alwaysprompted. In Internet Explorer you just have to choose Continue to this Webpage every time.

    You should see something like this

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    71/678

    Page71

    Its safe, just click continue

    You should get to a screen that looks like this

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    72/678

    Page72

    With all of your management tools are on the left. You can do almost everything from here,

    Webmin is an extremely powerful tool.

    I like to use a combination of Putty and Webmin to administer my Linux servers. But since this how-to is about doing it allthrough Webmin, we will stop using Putty, and start using the SSH module within Webmin when needed. The copy & pasteworks best in Putty, so if you see me switch back to Putty, its because I want you to copy \ paste a command, simply toavoid a hand cramp or typo.

    I just wanted you to have the experience of using Putty, in case you lock yourself out of Webmin, and to hopefully influenceyou to learn Putty, and learn command line later on down the road.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    73/678

    Page73

    you to learn Putty, and learn command line later on down the road.

    First thing we have to do is remove the current SSH module that came with Webmin, it has outdated ciphers in it, andwill not work. To remove the SSH Webmin Module, click on Webmin in the top left corner and chooseWebmin Configuration

    Next click on the icon that says Webmin Modules

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    74/678

    Page74

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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    75/678

    Page75

    Choose SSH Login and then click on Delete Selected Modules

    *Make sure you dont accidently choose SSH Server, its SSH Login you want to click on

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    76/678

    Page76

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    77/678

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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    78/678

    Page78

    If successful, it should say the module was successfully deleted

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    79/678

    Page79

    Thats it, its uninstalled. Now we have to install the new one.

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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    80/678

    Page80

    Click on the icon that says Webmin Modules

    Make sure youre in the Install tab of the webpage

    And choose from ftp or http URL

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    81/678

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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    82/678

    Page82

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

    The SSH2 Module will begin to open

    If youre ever prompted to install Java, its talking about the web browser on your Windows PC, not Java for your Linux box. Just goto http://java.com from your Windows PC and run the install if needed. If youre using Firefox, you may need to do this after everytime you upgrade your browser.

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

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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    83/678

    Page83

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

    If you dont like this single window view, you can click on the Module Config button and tell it to open in separate window.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    84/678

    Page84

    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.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    85/678

    Page85

    Here is what it will look like in separate window mode

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    86/678

    Page86

    Click enter on your keyboard, and login as root

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    87/678

    Page87

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

    When youre 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 tocontinue

    Webmin has a built-in command shell, that works awesome. And most commands have a built in yes option that can answer someprompts. But it doesnt allow you to interact and answer questions the way this SSH2 Module and Putty can. Putty allows you a muchwider copy\paste range than this SSH2 module. So if youre a copy and paster, you will like Putty much more (right-click = paste in

    P tt )

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    88/678

    Page88

    Putty)

    Again, I would encourage you to use Putty instead of this, but this particular how-to isnt about that :- )

    For the next step we are going to use Webmins built in command shell. Its super convenient when you dont need to interact with theanswer.

    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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    89/678

    Page89

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

    We need to make sure youre getting a full duplex connection and not half duplex

    If yours answers back full duplex then youre all set, and you can skip this part of the how-to.

    If it says half duplex then do not skip any pages

    If you simply got an error, that means mii-tool doesnt support your network card, this isnt a problem. Just run the command ethtooleth0

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

    (there is a space after ethtool)(thats eth ZERO, not eth OH)

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    90/678

    Page90

    If it says Duplex: Full then your good to go, you can skip the commands below.

    If it says Duplex: Half then do not skip any parts, you must fix this.

    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 that doesnt work, try ethtool, ethtool is better for newer network cards anyway.

    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 lineto the /etc/rc.local file

    ethtool s eth0 speed 100 duplex full autoneg off

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    91/678

    Page91

    ethtool s eth0 speed 100 duplex full autoneg off

    Here is how to edit that file the Webmin way, using the File Manager (youre going to like this) It makes everything a lot easier

    Click on Others and then Click on File Manager

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    92/678

    Page92

    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 isnt 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.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    93/678

    Page93

    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 thisabove exit 0

    mii-tool F 100baseTX-FD eth0

    (if you know the card is giga-bit, use 1000base in place of 100 in these commands)

    You should have something like this

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    94/678

    Page94

    Click Save & Close and thats 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 andcopy\paste this instead

    ethtool s eth0 speed 100 duplex full autoneg off

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    95/678

    Page95

    Click Save & Close and thats it, the file is edited

    (if you know the card is giga-bit, use speed 1000 in place of 100 in these commands)

    If you have skipped to this page, you missed how to use the Webmin File Manager to edit files.

    We are going to do it again so that everyone is on the same page.

    Click on Others and then Click on File Manager

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    96/678

    Page96

    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 isnt 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.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    97/678

    Page97

    You should see something like this

    You can type directly into that window

    Somewhere above the exit 0, copy and paste this

    # hello world

    You should have something like this.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    98/678

    Page98

    Click Save & Close and thats it, the file is edited

    We put a # in front of hello world so that it would ignore that line, Linux ignores lines that start with a #And in most cases, will ignore lines that start with a ;

    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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    99/678

    Page99

    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, lets go back to the File Manager and edit some more files.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    100/678

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    101/678

    Page101

    Change the line

    #alias net-pf-10 ipv6

    To

    alias net-pf-10 off

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    102/678

    Page102

    Make sure you remove the # from the beginning, or Linux wont read it.

    Click on Save and Close

    Next lets edit the file /etc/modeprobe.d/blacklist

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    103/678

    Page103

    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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    104/678

    Page104

    But since you have this how-to to refer back to, there isnt 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 didnt work.

    This isnt a Webmin problem. Anytime you switch from DHCP to static, or switch from one static IP to another, there are a few filesyou need to edit. As these files are expecting to get this information from the DHCP server, but static IPs dont communicate backwith 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, leave that line alone, you want to edit\replace 127.0.1.1

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    105/678

    Page105

    Click on Save and Close

    Then edit/etc/hostname (make sure its right)

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    106/678

    Page106

    Then edit

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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    107/678

    Page107

    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, itwont 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 lets familiarize ourselves with the Upload and Download module for Webmin.

    This isnt a very fast way of sending \ receiving files, because of the https encryption Webmin is using. That level of encryption is anawesome 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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    108/678

    Page108

    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.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    109/678

    Page109

    Lets 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 theDownload 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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    110/678

    Page110

    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 theDownload to file to directory field to be /options

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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    111/678

    Page111

    You wont always know the URL to the file you want, but you should be able to right click on it from your Windows PC, chooseproperties, and copy and paste the URL into the URLs to download field

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    112/678

    Page112

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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    113/678

    Page113

    You probably noticed how very slow that was, thats 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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    114/678

    Page114

    Lets edit some more files

    Lets 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 isnt the same as ssh_config, you dont want that, you want to edit sshd_config

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    115/678

    Page115

    You should see something like this

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    116/678

    Page116

    Somewhere towards the bottom, add the following line

    AllowUsers root wood

    Replacing wood with whatever username you created during the initial install.

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

    Basically dont give anyone but yourself SSH access.

    Dont 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 UserminThis is a Webmin like interface but can be locked down for users

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    117/678

    Page117

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

    But basically, dont ever give someone else Webmin or SSH access, it not a good idea until you have mastered Linux and arecomfortable with file permissions and jailing home directories.

    We will even be taking access away for root later on in the how-to. That way youre not ever typing that password over the internet.But for now, during the initial setup on your local network, its 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 somegood planning on your folder names, it can help with some of the confusion.

    Lets start by powering off the Linux box. You do this the same way you restart it using the Bootup and Shutdown module, but justchoose Shutdown System instead of Reboot.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    118/678

    Page118

    This how-to assumes you know how to physically install the second hard-drive, go ahead and do that now. When you done, use thecomputers 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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    119/678

    Page119

    As you can probably guess by the name, this folder is going to contain drives that you have mounted. The system mounts a lot ofdrives and partitions for you, as well as the CD drive, Floppy drives, etc to help avoid some of the confusion of mount points, youwill know anything inside this folder is actually a separate device (hard drive or partition) that you mounted yourself, this will helprefresh 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 otherdeeper folder.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    120/678

    Page120

    Just make sure to choose the new folder button, and not new file, and dont be tempted to click on mount, that isnt want you want

    You should see something like this when youre done

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    121/678

    Page121

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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    122/678

    Page122

    You should see something like this when youre done

    d2p1 stands for (drive two partition one)Its the second drive in the system, and its the first partition on that drive

    So what this folder structure means is. Its something you mounted yourself, because its in the mymounts folder. And its 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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    123/678

    Page123

    We need to format the second hard-drive. We need to so this before mounting it, because when its mounted, its considered in use. Sopre-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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    124/678

    Page124

    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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    125/678

    Page125

    Change the Type to LinuxThen 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 againAnd 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/hdb1This stands for device , hard drive B (B meaning 2

    nd) , 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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    126/678

    Page126

    You should see something like this.

    Dont 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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    127/678

    Page127

    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.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    128/678

    Page128

    Now that its installed and formatted, we can mount it.

    Using the Webmin module Disk and Network Filesystems

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    129/678

    Page129

    Change the Type box next to the Add mount button toLinux Native Filesystem ext3

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    130/678

    Page130

    Then click the Add mount button

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    131/678

    Page131

    You should see something like this

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    132/678

    Page132

    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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    133/678

    Page133

    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.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    134/678

    Change Use Quotas to User and Group

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    135/678

    Page135

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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    136/678

    Page136

    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 themore confusing tasks.

    Like for instance you probably already wondering why I didnt have you install Putty much much earlier, so you could have copiedand paste straight from this how-to. But then you wouldnt have learned how to type them correctly.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    137/678

    Or maybe you saw this window during the format

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    138/678

    Page138

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

    So even if you see a shortcut, try to follow the how-to exactly, because Im going to make assumptions later on in the how-to, thatcertain 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/

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    139/678

    Page139

    Just for practice, lets 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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    140/678

    Page140

    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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    141/678

    Page141

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

    If you ever need to un-mount it.

    (You shouldnt 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/

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    142/678

    Page142

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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    143/678

    Page143

    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 atboot and mount and then click Save at the bottom.

    Thats it for mounting and un-mounting. Again you shouldnt ever need to un-mount it, but you know how if you need it.

    Next lets 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, keepingin mind that its a 24 hour clock.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    144/678

    Page144

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

    Dont be tempted to use the Set system time to hardware time or the other one, just set each one manually.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    145/678

    You should see something like this

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    146/678

    Page146

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

    1.us.pool.ntp.org

    *If youre 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 youre 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.

    Youre 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 dothis if you are experiencing problems with the hardware clock.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    147/678

    Page147

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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    148/678

    Page148

    Thats about it for the time settings.

    Next lets make sure your MTU is set right on your network card. You usually wont see a problem here unless you have multipleNICs, but let make sure anyway.

    Using the Command Shell module, run the following commandifconfig eth0 then click the Execute command button

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    149/678

    Page149

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    150/678

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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    151/678

    Page151

    up /sbin/ifconfig eth0 mtu 1500

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    152/678

    Page152

    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 NICsthat 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.

    Thats it for MTU

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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    153/678

    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

    apt-get install mdadm

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    154/678

    Page154

    It will probably ask you to say Y or Yes

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    155/678

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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    156/678

    Page156

    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 noneThen 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 bootup, but its ok, its just telling us we havent configured it yet (we will do that later in Webmin)

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    157/678

    Page157

    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.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    158/678

    Page158

    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 itfirst. 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 usingWebmins 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.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    159/678

    Page159

    It will look for a couple minutes

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    160/678

    Page160

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

    Enable Monitoring, Enable sending notifications, Send them to yourname@localhostand click Save

    Choose a RAID configuration, in the drop down menu next to theCreate RAID device level of button.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    161/678

    Page161

    Again, for a fake software raid, I would only recommend RAID 1, or J.B.O.D. (Concatenated Linear) unless you have some incrediblyfast SATA or SCSI drives, then RAID 5 would be the highest I would go with the fake software raid.

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

    All these RAIDs do work awesomely, Im 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.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    162/678

    Page162

    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 haveto click on them with your mouse. In order to select the second disk, just hold down the control key on your keyboard when selectingthe second disk.

    Click the Create button, and it will create the RAID for you.This can take a very long time. If youre doing Terabyte disks, go to sleep :- )

    As you can see its 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 afolder for use on your system.

    You should eventually be returned to a screen that looks like this, if it shows your correct RAID configuration, and then youre readyto format it.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    163/678

    Page163

    Click on the device name, /dev/md0

    You should see something like this.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    164/678

    Page164

    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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    165/678

    Page165

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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    166/678

    Page166

    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/vraidThat name lets you know you mounted it, and that its a virtual or fake raid.

    You want to use the File Manager module to create that /mymounts/vraid folder first, before you attempt to mountit using the Disk and Network Filesystems module.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    167/678

    Page167

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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    168/678

    Page168

    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)

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    169/678

    Page169

    This is a very small example, I have done multiple Terabyte raids, and they work great. Just make sure you really need it, and aregetting 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. Im no longer using /mymounts/d2p1as my data drive.

    Im 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 raidhow-to, you will need to be thinking /mymounts/d2p1/

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

    Thats it for the data drive, now lets 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 shouldsee it displaying something like this.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    170/678

    Page170

    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, thats 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 lets use the File Manager module to delete the contents of the /var/www/ so we can replace it with our own index.html file, forour own custom website.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    171/678

    Page171

    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 MicrosoftExcel 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.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    172/678

    Page172

    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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    173/678

    Page173

    And save it as file name index.html

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    174/678

    Page174

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    175/678

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    176/678

    Then click the Upload button

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    177/678

    Page177

    Thats 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 yourwebsite.

    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.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    178/678

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    179/678

    Which looks like this from your File Manager view

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    180/678

    Page180

    Or, you could have both a webpage and the file download view by making a deeper subfolder called files and putting the files youwant 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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    181/678

    Page181

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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    182/678

    Page182

    Which would look like this from your File Manager view

    Thats 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, sothat people cannot get to certain websites or folders without a password, here is how.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    183/678

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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    184/678

    Page184

    This will give you the URL you need

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    185/678

    Page185

    Highlight and Copy that URL

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    186/678

    Page186

    Now go to the Webmin Configuration module

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    187/678

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    188/678

    Page188

    Make sure youre 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

    Or from my server http://t3.woodel.com/my-linux-how-to/htaccess-htpasswd.wbm.gz

    *Due to upgrades some versions may no longer be available, if you run into this just use the links to my server, this will ensurematching print screens,or go to webmin.com and find the newer link.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    189/678

    Page189

    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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    190/678

    Page190

    Click on it, you should see something like this

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    191/678

    Page191

    But we arent 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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    192/678

    Page192

    Change the following two lines from AllowOverride None to

    AllowOverride AuthConfig

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    193/678

    Page193

    Click the Save and Close button.

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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    194/678

    Page194

    Click Restart

    *Advanced* If you know youre not going to use apple-talk on your network, you can disable it on this pageBy putting a checkmark next to netatalk and choose Disable Now and On Boot

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

    Once its been restarted, navigate back to the Protected Web Directories module

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    195/678

    Page195

    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.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    196/678

    Page196

    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. Thats important, it means hidden.

    Its going to create this file for you, but it wont create folders for you. So make sure your specifying a directory that already exists,like /options

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    197/678

    Page197

    In the Authentication realm type Restricted Area

    Usually you would name the file containing users .htpasswd

    Thats the industry standard.

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

    Or

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

    Meaning to me, its in the /options folder

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    198/678

    Page198

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

    In Linux the leading period or dot in front of a filename means its a hidden file

    So when I see the filename .htpasswd-4-var-www-files we know its 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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    199/678

    Page199

    If successful, you should see something like this

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    200/678

    Page200

    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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    201/678

    Page201

    Here you can add as many usernames and passwords that you want. These arent real accounts on your server. You can makesomething 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 seethem. You could add a username and password like

    Username: myPassword: family

    And another one like

    Username: edPassword: 12345

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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    202/678

    Page202

    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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    203/678

    Page203

    And if they enter the right username and password here, they will be able to see the files inside the files folder (directory)Its a good idea to use made-up usernames and passwords for these websites. By made-up I mean not actual usernames and passwordsthat youre using as accounts on the server.

    These website passwords are sent over the network and internet in plain text, meaning its easy for a hacker to see the username andpassword that youre typing, so dont use a username and password here that actually has an account on the server.

    This isnt a huge deal because (at this point) you shouldnt be exposing files to the internet that you dont want people to see. Not overan http website anyway. If you doing really private information make sure youre using the Webmin File Manager module, orsomething else that uses ssl (https) or ssh.

    Youre 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 securelytransfer files using https. The s stands for secure and will secure the transfer using ssl.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    204/678

    Page204

    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 putanything confidential on a non https website. And as a rule of thumb, dont expose anything confidential to the internet. And nevertype your password on a website that isnt https. And never type your password on a website you dont 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 dont put any confidential files on your web server, and dont typeusernames and passwords that matter, over a non https connection.

    No worries about Webmin and Putty, they are safe, Im 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

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    205/678

    Page205

    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 anddownload 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 witha lot more functionality. They will be able to FTP, build websites, use the secure https File Manager, change their passwords, seegraphs on how much space is available, have disk space Quotas, etc all over a webpage.

    Lets configure the FTP server (vsftp)

    Using the File Manager module, edit the file /etc/vsftpd.conf

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    206/678

    Page206

    You should see something like this

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    207/678

    Page207

    You need to make the following changes to it

    Change line 23 from anonymous_enable =YES to anonymous_enable =NO

    Uncomment line 26 by removing the # so that it reads local_enable=YES

    Uncomment line 29 by removing the # so that it reads write_enable=YES

    Uncomment line 33 by removing the # so that it reads local_umask=022

    On or around line 34, add the following entry file_open_mode=0755

    Uncomment line 94 by removing the # and change the Welcome string to something custom of your own

    Uncomment line 105 by removing the # so that it reads chroot_local_user=YES

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    208/678

    Page208

    You should eventually see something like thisWhen you have made all the changes, click save and close

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    209/678

    Page209

    The next time the computer is restarted, the FTP server will read the new changes, and will be ready to use. We havent added any

    users for it yet, we will get to that later, but we are done as far as its configuration.

    If you dont want to reboot, you can just restart the vsftp service instead.

    Using the Bootup and Shutdown module, find vsftpd

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    210/678

    Page210

    Put a check in the box next to vsftpd and click the Restart button

    This will restart the FTP service, without restart your computer. Either way is fine. Now you have a fully functional FTP server. Wewill test it later, when we add some more users with less important passwords. Much like HTTP, passwords sent over FTP are alsosent in plain text, thats why I dont want you to test it right now with your important accounts and important passwords.

    Thats it for FTP for now

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    211/678

    And to check the syslog, use the System Logs module

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    212/678

    Page212

    You can also find useful information in the View Module Logs module

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    213/678

    Page213

    A lot of the time the answer to your problems will be in one of those (3) places

    And the homepage (also called the System Information module) does a good job of showing you your current usages.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    214/678

    Page214

    As we can see above, even with everything we have added to the computer, its still only using 34MB of ram, 0MB of the Pagefile,and 0.02 of the processor. *** note, this particular computer is a only a P3 \ 450Mhz a paper-weight at best. Isnt Linuxamazing?

    These awesomely low numbers are because we are using the command line version of Linux, and not a GUI Operating System.

    You can also see your Uptime and OS version, Disk-Space, and other important information.

    Next lets add some user accounts, these would be people you would give access to your server and its resources.

    We will create the accounts, and setup their home directories to be on the data drive, and exposed to the network\internet.

    Using the Users and Groups module

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    215/678

    Page215

    We are going to get a lot of use out of this module. It will allow us to make users, groups, set passwords, set home directories, andeven setup their shell, where we can further restrict them if needed.

    Click on Create a new user

    You should see something like this, make the following changes

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    216/678

    Page216

    With the username jdoe and the real name jdoe.

    I like to keep the username and the real name the same, but the only important one is the username, that will be the actual login name.You could set the real name to Mr. John Doe, or something more descriptive if you like. I personally like to keep them the same.

    Un-check Automatic and set the Home directory to/mymounts/vraid/users/xhomes/jdoe

    If you arent using raid, and are using d2p1, you would type/mymounts/d2p1/users/xhomes/jdoe

    What these descriptive folder structures tell us is-Its a drive I mounted

    -What drive its on-Its user data-Its and exposed home directory xhomes-Its user jdoe

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    217/678

    Page217

    By exposed home directory, I mean that directory is exposed to the network or the internet. A constant reminder to me about securityand confidentiality of what goes in there

    We are later going to change the web server (Apache) to listen in those directories, so these home directories will be folders that areexposed and viewable over the network or internet.

    Thats on purpose, to give them web space.

    After you have set the username and home directory, choose normal password and lets type in the password jdabc123

    Set the Group to New Group With Same Name As User

    Then click the Create button

    If successful, you should see something like this

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    218/678

    Page218

    Little advice, careful if you ever click on a user, it will go into Edit User mode, and will try to reset the password.

    Of course it wont do it unless you hit apply

    But try not to edit your users once they start using it, unless you know their password.

  • 8/8/2019 Debian Howto Start to Finish Using Webmin

    219/678

    Page219

    You probably noticed I didnt have you put jdoe in a group, but instead created a group with the same name of jdoe. Groups areawesome, so thats a good question. We will cover groups later, but for now lets focus on users.

    In this scenario you really dont need groups, because your users will be accessing their own home directories. And the entireoperating system is kind of built around that idea, and gets the right settings and permissions by default.

    Its when you venture outside the home directories that you will find yourself overwhelmed with permissions, and then groups are awonderful thing. Also if you want yo


Recommended