Raspberry Pi Home Server: Part 4, Web Administration

Article Obsolete

A new version of this series has been published. Please refer to the new index for updated articles and ordering. This article is kept for historical reference, but should be considered out of date.


Note: This article is part of a series. See the Index for more information.

Self-promotion: I’ve recorded this series as a screencast for Pluralsight:
(http://www.pluralsight.com/courses/raspberry-pi-home-server)
If you have a Pluralsight subscription, please consider watching it. Thanks!

Updates: Everything in this post seems to work just fine under Jessie, so there are no changes to report.


SSH is a simple way to remotely log in to your machine’s command-line interface, but that’s not always the most convenient way to work. There is a wonderful web administration system called Webmin that can handle a lot of the “magic” of system configuration. Webmin can take care of a lot of the tasks you’d normally do from the command line, but in a much friendlier way. In addition, you can add Webmin modules for many of the features we’ll be adding to the Raspberry Pi in this series.

It’s pretty easy to install, so let’s get started.

You can’t just install Webmin through apt-get like the other software packages so far because apt-get doesn’t know about Webmin, or at least it doesn’t know about it yet. There are several approaches to a Webmin installation, but I’ve found that the easiest is to simply tell apt-get where to get the packages it needs for Webmin. Edit apt-get’s list of sources like this:

sudo nano /etc/apt/sources.list

When the editor appears, add the following two lines to the end of the file:

deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib

Note: Your browser may wrap these lines, but make sure they go in the sources.list as two lines like this:

image

Press Ctrl-x,y,enter to exit nano, saving the file. Next you’ll need to import the signing key that verifies the packages coming from the new repository. These next few commands need to be run as the actual root user of the machine. This is the first time this series has done this, so I’ll break it down for you. Type the following to temporarily become the root user:

sudo su

Your command prompt will change, losing all of its color, and becoming more sinister, dark, and dangerous looking like this:

image

You are now operating as the root user of the machine. The root user can do pretty much anything. Unlike the Windows world, Linux users try to spend as little time in “God-mode” as possible.

Type the following commands to import the Webmin repository’s signing key:

cd /root
wget http://www.webmin.com/jcameron-key.asc
apt-key add jcameron-key.asc
exit

That last “exit” tells the system that you want to stop being the root user now, and go back to being “pi”. The final result should look like this:

image

Now that you’ve added Webmin’s repository to the list of places apt-get will look for stuff, update the list of available packages again.

sudo apt-get update

Note: You may or may not see an error during this process. I presume that’s why the Webmin folks had you add two repositories, in case one of them is down. If you get an error, try the next steps anyway. If it still fails, double-check that you got the repository addresses exactly right, and try again.

Now that apt-get knows where to get Webmin, you can install it just like you have everything else so far.

sudo apt-get install webmin

When the installation is complete, you can test it by opening a browser, and navigating to the IP address of your server, but specifying https and port 10000 rather than the default http port of 80. If you forget the “https” part, you’ll see a friendly page that offers to redirect you. Either way, you’ll probably also get a warning about the site not having a valid certificate, which it doesn’t. Proceed to the page anyway, and the result should look like this:

image

Log in as “pi”, and you’ll see the main Webmin interface, which looks like this:

image

Poke around a bit, and see what Webmin is all about. You can monitor storage and memory usage from here, be notified about updates, apply them, manage user accounts, and a lot more.

Look inside the “Un-used Modules” section to see all the things that Webmin could help you manage, if you had those packages installed. It’s a pretty impressive list.

Wrapping up

You’ve reached another milestone, and I strongly recommend politely shutting down the Raspberry Pi (sudo shutdown –h now), and taking another backup of the SD card.

What’s next?

In the next post, we’ll add the ability to remote desktop into the Raspberry Pi.

This entry was posted in Computers and Internet, Home Server, Raspberry Pi and tagged . Bookmark the permalink.

27 Responses to Raspberry Pi Home Server: Part 4, Web Administration

  1. Pingback: Raspberry Pi Home Server: Index | MelGrubb.ToBlog()

  2. Pingback: Raspberry Pi Home Server: Part 3, Configuring the OS | MelGrubb.ToBlog()

  3. Pingback: Raspberry Pi Home Server: Part 10, CrashPlan | MelGrubb.ToBlog()

  4. Pingback: Raspberry Pi Home Server: Part 10, CrashPlan | MelGrubb.ToBlog()

  5. Pingback: The Raspberry Pi Home Server – Part 1 | UnaX.dk

  6. scottvoyles says:

    Had no problems with my RPi 2 + Jessie. Many thanks!

  7. gilad says:

    During “sudo apt-get install webmin” the process seem to hang at the stage of
    “unpacking webmin(1.770) over (1.770)”
    It’s now more than an hour like this.
    Any idea what is happening?

    • Mel Grubb says:

      I’ve seen a delay during the installation, but certainly not an hour. Maybe the internets are clogged. You could try ctrl-C-Ing your easy out of it and starting the install again just to see if it behaves any differently. The text you included reads like it’s reinstalling a version that’s already present, though. I’m a little intrigued by that. I don’t have the normal text committed to memory, but the phrasing above seems to suggest that to me.

      • gilad says:

        Well eventually the process completed – that was very long.
        Actually I did a ctrl-c before posting this question. After that It refused to install again and I had to run “dpkg –configure -a” to fix it and run the installation again.

  8. Paulo Gomes says:

    Hi, i’m facing the exact same issue as Gilad, had to dpkg ans trying to reinstall as I type this message

  9. Paulo Gomes says:

    In my case, I cannot say for sure that it was not on my end, since my dsl connection is very bad and somewhat unstable!

  10. Pingback: CrashPi – An off-Site backup for the whole family | MelGrubb.ToBlog()

  11. Dave says:

    Hi Mel, I did all the steps, but cannot login. I’m running OSMC – which is probably why it’s not working. When I SSH the username is: osmc, and the password is: osmc. Any ideas would be most welcome. Cheers, and have happy new year when it comes.

    • Mel Grubb says:

      I can’t make any promises for any installation that didn’t start from a normal Raspbian image. I haven’t tried any other starting points myself. Different distros behave differently, though. What is the actual problem you’re having, though?

      • Dave says:

        Thanks for getting back to me.

        It’s the Webmin login page. Can’t figure out what login name/password to use to get in. In your example you used ‘Pi’ – which I’m guessing is the Raspbian default. I tried ‘osmc’ – the OSMC default(for user name and password), but it didn’t work. I’ve read that OSMC doesn’t allow root – you have to sudo everything. Maybe that’s the issue.

        Just wondered if you had any ideas how to make it work. It’s no bother if you don’t, I’m quite enjoying the challenge – the more walls I hit, the more I learn.

      • Mel Grubb says:

        Raspbian doesn’t allow root either, so you log in as the “pi” user. That sounds like the same thing as you’re seeing with OSMC. I would think you would log in with the “osmc” user, and whatever it’s default password is.

  12. Zerio XIII says:

    Hey, I don’t see any LAMP tutorial on this part, yet you mention it in part wordpress

  13. Pingback: Sécuriser votre RPi | Ma Vie de Linuxien, dans les Nuages!

  14. Jeff says:

    Webmin instructions update:
    The entry for the mirror hosted at somersettechsolutions can be removed based on a posting at http://www.webmin.com indicating that the mirror is outdated.

  15. .. says:

    Got this working.

    It’s going to be a bit hard to use when connected to friends network.

    Any chance you could do a section on ddclient & dyndns.

    I tried to get it working but it seems a little flakey.

    • Mel Grubb says:

      The way CrashPlan works, this shouldn’t be a problem as long as the friend’s router isn’t blocking ports. When you sign into your account on the CrashPi, it should take care of the “I’m over here” part itself. The account is what ties all of your different instances together. My own CrashPi lives in my detached garage, so it’s on my same network, but away from the house. It’s a just-barely-offsite backup, but it has worked well for me. I haven’t had to park one at someone else’s house yet, myself, but from my understanding of how CrashPlan works, you don’t need to be aware of its actual IP address.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s